Moving your WordPress website to one other location could be a tense and fiddly expertise, not helped by the actual fact you may’t simply merely transfer your recordsdata and database. No, that’s simply not how WordPress works.
Fortunately, WordPress has a useful “Import” and “Export” instrument in-built. But sadly, it’ll solely go well with some fundamental necessities and also you want to improvise a bit of to obtain different results.
In this article, I’ll present you step-by-step how to migrate your WordPress set up’s content material to a brand new place.
Let’s get cracking!
Before We Start: Back Up Your Website
Some WordPress installations or server setups could current you with distinctive challenges on migrating content material. Although this text will take care of an extra distinctive eventuality (specifically that you just solely need to switch a half of your WordPress set up’s content material), there’s no assure that the steps detailed right here will unfailingly work for each setup.
It goes with out saying that you just’re solely liable for your website, even when following this information to the letter; there’s some database work concerned relying on what you need to do, and in case you by accident delete an enormous chunk of your website, that’s down to you. Basically, watch out with this!
For the needs of this publish, I’ve created two separate localhost installations of WordPress to offer you footage of every step. You would possibly like to attempt shifting your content material to a take a look at website to examine it really works.
To that finish, I’d suggest making a backup of your total website at this level. Of course, you do this repeatedly, don’t you? (If not, you positively must be. Get to it.)
If you need to do that manually, keep in mind to embrace each your database and website recordsdata (primarily as a result of this contains your web site’s Uploads folder).
Backing Up Files
You can create and obtain a ZIP of your website recordsdata through FTP. How to do that varies per FTP shopper however is usually pretty apparent. Make certain you obtain and securely retailer your backup compressed file – simply as with every backup.
Backing Up Your Database
Login to your phpMyAdmin account and choose the database through which WordPress is put in.
Select Export from the highest menu. For most individuals, “Quick” choices might be sufficient. However, you probably have tables apart from the WordPress set up you need to again up in the identical database, click on Custom to choose the tables you need to again up; all different choices ought to stay untouched. Finally, click on Go to obtain your database backup file (.sql format).
Hopefully, these backups gained’t be wanted, however it’s all the time advisable earlier than embarking upon such work. If the positioning to which you’re migrating content material already has content material, be sure you again up that one too.
With precautions out of the way in which, let’s get to work!
Changing Your WordPress Installation’s URL? Transferring a Whole Site
If you’re simply wanting to change your web site to a brand new URL or in any other case need to switch completely every part from one set up to one other, the excellent news is that you just’ve picked the simple choice. WordPress’s personal import and export instruments will work completely for you so no want to do something too difficult underneath the hood.
Here’s how to switch all your WordPress content material – pages, photos and recordsdata, posts and every part else – to a brand new set up.
Incidentally, it’s most likely best to create a brand new set up in your new server (and even the brand new location inside a server) and import/export than to change your recordsdata’ configurations. However, in case you’d relatively do it that means, the WordPress Codex can advise. Your set up must be up-to-date with the newest WordPress model so it gained’t be an issue, but when it’s not, improve your outdated set up first. If you actually can’t replace for some cause – comparable to conserving a plugin that doesn’t work with new variations – your new set up could be an old version. This is way from beneficial as a result of many elderly variations of WordPress have essential safety flaws.
How to Move Content From One WordPress Site to Another
1. Export From Your Old Installation
Go to your WordPress dashboard and choose the Export merchandise from the Tools part.
Because you’re exporting every part, it’s simple: maintain the All content material choice chosen and hit Download Export File.
An XML file might be created. Keep it in a protected place and go throughout to the set up to which you’re migrating.
2. Install the Importer
On the brand new WordPress set up, go as soon as once more to Tools, however this time choose Import.
You might be proven an inventory of importers, from which you must choose the WordPress choice.
Click Install Now and watch for the importer plugin to obtain and set up.
If all of it works, you may click on Activate Plugin & Run Importer on the subsequent display.
At this level, you’re all prepared to import and the XML file you generated earlier comes into play.
3. Upload Your Content
Click Choose File on the display that follows and choose the XML file you created on the outdated website.
Next, click on Upload file and import.
4. Assign the Content
You’ll be given an choice to assign content material to present customers on the brand new website (you probably have an account on each, you may assign your outdated posts to your new account), or create new customers both with their outdated usernames or with a brand new one you choose. This ensures all of the content material is attributed to an writer account that exists on the brand new website.
If you could have any photos or recordsdata to transfer to the brand new website, make completely certain that you just tick Download and import file attachments – it’s not chosen by default.
Hit the Submit button and also you’re finished! The web page could take a bit of longer than regular to load as a result of it’s creating all the brand new rows on the database, however it will get by means of it. Just wait patiently for it to be processed and your whole content material must be imported onto the brand new website prepared for its life there.
Partial Content Movement
So that’s the simple bit out of the way in which. However, in case you’re wanting to export solely some of your content material, I’m afraid to say that WordPress’s instruments most likely gained’t cater in your wants on their very own.
Selecting All content material is the one means to export your attachments (recordsdata that seem underneath the Media part). Therefore, in order for you to switch particular components of the content material and your photos, you’ll both want to transfer every part throughout then delete it (time consuming for bigger websites) or poke round in your recordsdata and database – which I shall present you the way to do now.
The exporting and altering SQL that I’m about to present you’ll be demonstrated for shifting attachments, however you may also use an identical methodology to switch the entire database throughout. This is beneficial in order for you to switch every part however your XML file is just too massive to add by means of the importer.
1. Select the Content You Want to Export
Venture as soon as extra to the Tools > Export display to start with.
Once you’ve chosen which content material you’d like to export, click on Download Export File as earlier than. If there are a number of choices you’d like to make (eg. two authors’ posts in a date vary, or somebody’s posts and all pages), it’s solely attainable to return and create a number of export recordsdata for every choice.
2. Import as Before
After you could have all of the WXR XML recordsdata you need, go to the brand new website and set up the WordPress Importer as beforehand proven. You can add your recordsdata (one after the other) as earlier than and so they’ll set up the precise posts/pages/different content material onto the positioning.
However, this isn’t the tip, since you’ll discover that you just nonetheless don’t have any attachments (eg. uploaded photos) in your set up fairly but.
3. Duplicate Media Files
Go to your outdated set up’s FTP shopper and discover the /wp-content/uploads/
folder. I’m utilizing Windows 10’s File Explorer as my FTP shopper, however most ought to give you the chance to compress recordsdata and obtain them.
Download the .ZIP file you generate and add it to your new website’s FTP (or minimize and paste it in case you can entry each websites by means of your FTP shopper).
You can then extract all of the recordsdata from the compressed folder into the Uploads listing.
Unfortunately, that’s not the tip of it; whereas your recordsdata are in the proper place, your WordPress set up gained’t find out about them as a result of the attachment particulars haven’t but been copied throughout from the database.
4. Export Attachment Posts
Head over to your outdated website’s phpMyAdmin database and discover the wp_posts
desk (substitute wp_
together with your prefix as crucial).
At this level, you want to discover the attachment posts (these are the media posts) so paste within the following SQL (altering the desk identify to have the proper prefix if crucial) and hit Go.
SELECT * FROM `wp_posts` WHERE `post_type` = "attachment"
Scroll to the underside of the question outcomes and examine Show all so all attachment posts are exhibiting. Once all rows are displayed, select Check All then click on Export.
At this level, issues get a bit extra difficult, however stick with me and comply with the steps fastidiously and you need to be superb.
- Choose Custom to present all attainable settings.
- Scroll down to the Format-specific Options part.
- Choose information.
- Leave every part else as it’s and click on Go.
5. Edit Your SQL
This step is important in case your new set up has a distinct database prefix to the one from which you’ve simply downloaded your SQL export file.
Edit the .sql file utilizing a textual content editor comparable to Notepad++, discovering and changing the outdated prefix with the brand new prefix.
If your prefixes are the identical (eg. each tables are wp_posts
), that’s superb and you’ll ignore this step.
6. Import Attachment Posts
Go to your new database and discover wp_posts
(or equal); click on Import.
Click Choose File – be sure you click on, don’t drag it in, as this implies it gained’t be uploaded in the proper place – and choose the exported SQL file.
Leave all different choices as they’re and execute the question by hitting Go. You’ll see a hit message as soon as it’s completed and all of your attachments will now be seen underneath Media – though there’s an extra step earlier than your photos will begin exhibiting up correctly.
7. Export Post Meta
Similar to the earlier database work, this time discover your outdated set up’s wp_postmeta
desk and choose the Export tab.
Select Custom settings once more and select information relatively than construction and information, simply as earlier than.
This time, additionally find the Data Creation Options heading and choose REPLACE because the perform to use when dumping information.
Once once more, click on Go to create and obtain your SQL file.
8. Edit Your SQL
Again, you want to change the prefixes in your SQL file if the brand new database prefix might be totally different. You also needs to discover all references to your outdated URL and substitute them with the brand new one.
9. Import Post Meta
Go to your new wp_postmeta
(or different relevant prefix) desk and, precisely as earlier than, import your edited SQL file into the brand new set up.
Your media library is now full as soon as extra, prepared to match again into your transferred content material (lastly).
Finishing Up
If you’ve acquired by means of all that, effectively finished – it’s a little bit of a roundabout technique simply to switch some photos throughout with particular posts.
Of course, there are nonetheless catches with this: in case you solely need to migrate among the photos, you want to undergo and pick the folders (hopefully you need them by date or it might take eternally) extra fastidiously when importing. You may additionally run into bother with duplicate main keys transferring wp_posts
in case you already had posts on the brand new set up.
Clearly, to make the Import/Export course of extra intuitive – relatively than requiring such artistic considering with the databases behind the CMS – some work will want to be accomplished for a future WordPress launch. While we wait, nevertheless, in case you do want to transfer a few of your content material, this could be just right for you – it’s effectively well worth the time!
If you’ve acquired any extra concepts and strategies for shifting throughout components of a WordPress set up with all of the content material in tow, we’d love you to share it with us within the feedback. Likewise, tell us in case you’re having any points with these strategies and we will attempt to provide you with a hand.
Tags: