Good day!
How do you properly migrate your localhost wordpress file to a live server? What I do is usually copy all my wordpress file then transferred to my website thru FTP and the database is usually imported to the target sql.
The problem is when I do this, the website layout gets all messed up. I wanted to migrate my website without the layout being affected.
Thanks.
Good day!
How do you properly migrate your localhost wordpress file to a live server? What I do is usually copy all my wordpress file then transferred to my website thru FTP and the database is usually imported to the target sql.
The problem is when I do this, the website layout gets all messed up. I wanted to migrate my website without the layout being affected.
Thanks.
Share Improve this question asked Jun 3, 2019 at 5:20 marvin castromarvin castro 354 bronze badges 5- You can try WP Migrate DB plugin to export your database to move it to live. It will not break the site. – Bhupen Commented Jun 3, 2019 at 8:12
- I would just use the export/import tools that come with WordPress. – Valentin Genev Commented Jun 5, 2019 at 11:51
- @Valentin Genev that only transfers the content. Not the theme or the plugins or the plugin settings. – Pothi Kalimuthu Commented Jun 7, 2019 at 0:39
- @PothiKalimuthu Ah, I see! So the other solutions should migrate everything even if the developer doesn't have FTP account? – Valentin Genev Commented Jun 8, 2019 at 9:24
- @Bhupen I have tried using WP Migrate DB, not all is being transferred. – marvin castro Commented Jun 10, 2019 at 2:12
3 Answers
Reset to default 2You can use the WP CLI too to rename your site's hostname safely and effectively. There's a chance that your layout is being messed up because naively replacing the domain name with a simple string replace, e.g. perl -pi -e 's/oldhost/newhost/g' backup.sql
, will not take into account things like serialized data.
Try this on your local machine after install WP-CLI:
Using the db-checkpoint
package:
wp package install binarygary/db-checkpoint
wp dbsnap pre-search-replace
wp search-replace --precise oldhost newhost
wp dbsnap post-search-replace
wp dbsnapback pre-search-replace
Now, take the file in wp-content/uploads/checkpoint-storage
that starts with post-search-replace
and import that to your remote host.
Without db-checkpoint
:
# Backup your database here, this will be restored to your local once the
# operation is done
wp search-replace --precise oldhost newhost
# Take another backup now - this backup will go to your remote server
# Now, restore your original backup to have your local in a working state...
# OR do this:
wp search-replace --precise newhost oldhost
Make sure to also change the site URL in your database under the wp_options table. And it should work.
I always recommend https://wordpress/plugins/duplicator/ to move your entire site. It makes the process really easy and also takes care of any database replacements needed during migration.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745441082a4627835.html
评论列表(0条)