admin管理员组文章数量:1425251
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.
本文标签: migrationMigrate localhost to server
版权声明:本文标题:migration - Migrate localhost to server 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745441081a2658451.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论