admin管理员组文章数量:1332620
I'm trying to transfer a WordPress site to a new server, but I've looking to do it in a clean way. Although, I can simply dump the database and transfer it to the new server, I would like to find a way to only transfer the what's necessary to start from scratch, such as posts with custom fields and settings, images, and attachment information. Then I want to configure the plugins and settings manually again.
Is there a way to accomplish this task?
I have tried using using the WordPress importer, but if I tried to a dump of everything, the import will not work complete successfully for 7000 posts, and if I try to export the posts and the media, then the image attachment ("Uploaded to this post" option in the upload media from the post editor) to post will go missing.
I'm trying to transfer a WordPress site to a new server, but I've looking to do it in a clean way. Although, I can simply dump the database and transfer it to the new server, I would like to find a way to only transfer the what's necessary to start from scratch, such as posts with custom fields and settings, images, and attachment information. Then I want to configure the plugins and settings manually again.
Is there a way to accomplish this task?
I have tried using using the WordPress importer, but if I tried to a dump of everything, the import will not work complete successfully for 7000 posts, and if I try to export the posts and the media, then the image attachment ("Uploaded to this post" option in the upload media from the post editor) to post will go missing.
Share Improve this question edited Jul 11, 2020 at 13:38 fuxia♦ 107k38 gold badges255 silver badges459 bronze badges asked Jul 11, 2020 at 13:31 mhwebmhweb 651 silver badge6 bronze badges3 Answers
Reset to default 1Strategy for cleaning up
To give a high level answer to your question, there basically isn't a way to achieve this completely cleanly with Wordpress. The reason for this is that Wordpress doesn't enforce a 'contract' for the data structure with its themes or plugins. There's no way Wordpress core can say 'Plugin, tell me exactly what database tables and fields you use' so that it could then know exactly what data to move or delete for that plugin. So there's no way you can know this either in a quick, clean way.
Because of this, cleaning up will always be a manual and imperfect task in Wordpress, unless you review the code of your plugins and theme in detail to figure out where the data is and how it's connected, but this would probably take a long time.
You might remove something that you need, or you might leave behind something you don't need.
With this in mind, I would suggest making your life as easy as possible. Figure out some goals that are important to you and optimise your time to those. Otherwise you may spend a lot of time to make small changes that don't actually give you much benefit for your situation.
For example, things you might want to:
- Reduce disk space used
- Reduce size of database
- Decrease page load time
- Decrease server load
- Remove plugins which cause errors
- Remove unused items from Media Library UI
If you get your site in a broken state you may have a huge piece of work to fix it, which is why I'd strongly recommend making a perfect copy, then optimising just the things you actually need to.
How to do transfer in your case
I would recommend firstly doing a complete transfer of your site to a temporary location where you can work on it safely. As you said, dump and restore the whole database, or perhaps use a plugin for transferring sites, copy the entire file system, do the settings updates required to make your site work on a temporary URL. There are lots of resource on how to do this.
Then fix whatever you need to fix and don't worry about anything else and keep things in a working state. Test often after you make changes and be able to revert easily so you can make small incremental changes, test quickly, go back if it's broken.
I suggest it a lot, but Query Monitor will get you a good quick view of what's loaded and when.
Then for other specific goals you can probably find answers here for specific things quickly. E.g. removing unused media items
I hope that's helpful, and perhaps others will have answers on being able to cleanly remove / optimise other parts of your Wordpress install.
as mentioned, SQL syntax is very specific. Is a comma or a bracket is out of place; it will not bother trying to figure it out. It will just error out completely and not run the query.
So, I don't think something as simple as a syntax error is causing your CPU spikes.
First, focus on trying to identify as best you can what service is causing the CPU spike. If you have access to the machine which this lives; there are many tools that can help here.
Second, I have seen situations where someone programed a plugin badly and the plugin is storing large images or other binary data. And very large amounts of it at that. However, if anything like that happened in the past and that data is still living in your database; you should be able to easily find it if you look for large chunks of data in your DB. Additionally, you can use different clients to explore the DB. But also remember, that if you are no longer accessing that data (i.e. turned off the offending plugin); then you should not be having too many problems.
I guess the biggest question like many have, is what is the problem. What is going on badly with with the website besides your feeling that something is wrong? Is it quantifiable in anyway in actual functionality of the website?
Cheers, T
If I was moving to a new host (or even doing a new upgrade), I'd use a cloner like Clone (Automaticc) plugin to copy entire site, content, images, etc to a new place. ("Clone" zips everything, and then you import that into a new/fresh install. Works quite well, and fast.)
Then, I'd delete any unneeded plugins and themes, then do a mass delete of posts and pages I didn't want, ending up with the base system plus the posts/pages I wanted to retain.
Then, install a new theme (if desired), configure it, add plugins as needed. Once all is done and tested, use your hosting's cPanel to assign the domain name to that new folder.
A bit more work, but unless you are really good with SQL commands, less chance of screwing up the database and other things.
本文标签: migrationHow to do a clean transfer of WordPress site to a new server
版权声明:本文标题:migration - How to do a clean transfer of WordPress site to a new server? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742270687a2444247.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论