How to Move Content From One WordPress Site to Another

Moving your WordPress site to another location can be a stressful and fiddly experience, not helped by the fact you can’t just simply move your files and database. No, that’s just not how WordPress works.

Fortunately, WordPress has a handy “Import” and “Export” tool built in. But unfortunately, it’ll only suit some basic requirements and you need to improvise a little to achieve other effects.

In this article, I’ll show you step-by-step how to migrate your WordPress installation’s content to a new place.

Let’s get cracking!

Before We Start: Back Up Your Website

Some WordPress installations or server setups may present you with unique challenges on migrating content. Although this article will deal with an additional unique eventuality (namely that you only want to transfer a part of your WordPress installation’s content), there’s no guarantee that the steps detailed here will unfailingly work for every setup.

It goes without saying that you’re solely responsible for your site, even when following this guide to the letter; there’s some database work involved depending on what you want to do, and if you accidentally delete a huge chunk of your site, that’s down to you. Basically, be careful with this!

For the purposes of this post, I’ve created two separate localhost installations of WordPress to provide you with pictures of each step. You might like to try moving your content to a test site to check it works.

To that end, I’d recommend making a backup of your entire site at this point. Of course, you do that regularly, don’t you? (If not, you definitely should be. Get to it.)

If you want to do this manually, remember to include both your database and site files (primarily because this includes your website’s Uploads folder).

Backing Up Files

You can create and download a ZIP of your site files via FTP. How to do this varies per FTP client but is generally fairly obvious. Make sure you download and securely store your backup compressed file – just as with any backup.

Backing Up Your Database

Login to your phpMyAdmin account and select the database in which WordPress is installed.

Select Export from the top menu. For most people, “Quick” options will be adequate. However, if you have tables other than the WordPress installation you want to back up in the same database, click Custom to select the tables you want to back up; all other options should remain untouched. Finally, click Go to download your database backup file (.sql format).

phpMyAdmin Database Export Options
Your WordPress tables are prefixed “wp_” by default – since I have two installations in the same database, mine are actually prefixed wpmudev_export and wpmudev_import. Here, I’m backing up the wpmudev_export files.

Hopefully, those backups won’t be needed, but it’s always advisable before embarking upon such work. If the site to which you’re migrating content already has content, make sure you back up that one too.

With precautions out of the way, let’s get to work!

Changing Your WordPress Installation’s URL? Transferring a Whole Site

If you’re just looking to change your website to a new URL or otherwise want to transfer absolutely everything from one installation to another, the good news is that you’ve picked the easy option. WordPress’s own import and export tools will work perfectly for you so no need to do anything too complicated under the hood.

Here’s how to transfer all your WordPress content – pages, images and files, posts and everything else – to a new installation.

Incidentally, it is probably easiest to create a new installation on your new server (or even the new location within a server) and import/export than to change your files’ configurations. However, if you’d rather do it that way, the WordPress Codex can advise. Your installation should be up-to-date with the latest WordPress version so it won’t be a problem, but if it’s not, upgrade your old installation first. If you really can’t update for some reason – such as keeping a plugin that doesn’t work with new versions – your new installation can be an old version. This is far from recommended because many old versions of WordPress have critical security flaws.

How to Move Content From One WordPress Site to Another

  1. Export From Your Old Installation
  2. Install the Importer
  3. Upload Your Content
  4. Assign the Content

1. Export From Your Old Installation

WordPress Export Page.
WordPress’s own Export Tool.

Go to your WordPress dashboard and select the Export item from the Tools section.

Because you’re exporting everything, it’s easy: keep the All content option selected and hit Download Export File.

An XML file will be created. Keep it in a safe place and go across to the installation to which you’re migrating.

2. Install the Importer

WordPress importer options.
The WordPress importers screen.
Importer Install screen

On the new WordPress installation, go once again to Tools, but this time select Import.

You will be shown a list of importers, from which you should select the WordPress option.

Click Install Now and wait for the importer plugin to download and install.

If it all works, you can click Activate Plugin & Run Importer on the next screen.

At this point, you’re all ready to import and the XML file you generated earlier comes into play.

3. Upload Your Content

Screen to upload WXR XML file
Upload the WordPress eXtended RSS (WXR) XML file you created earlier.

Click Choose File on the screen that follows and select the XML file you created on the old site.

Next, click Upload file and import.

4. Assign the Content

Importer Content Attribution Options.
You can import or add new author accounts, or attribute content to existing authors. Ensure you import and download attachments.

You’ll be given an option to assign content to existing users on the new site (if you have an account on both, you can assign your old posts to your new account), or create new users either with their old usernames or with a new one you select. This ensures all the content is attributed to an author account that exists on the new site.

If you have any images or files to move to the new site, make absolutely sure that you tick Download and import file attachments – it’s not selected by default.

Hit the Submit button and you’re done! The page may take a little longer than usual to load because it’s creating all the new rows on the database, but it will get through it. Just wait patiently for it to be processed and all of your content should be imported onto the new site ready for its life there.

Partial Content Movement

So that’s the easy bit out of the way. However, if you’re looking to export only some of your content, I’m afraid to say that WordPress’s tools probably won’t cater for your needs on their own.

Selecting All content is the only way to export your attachments (files that appear under the Media section). Therefore, if you want to transfer specific parts of the content and your images, you’ll either need to move everything across then delete it (time consuming for larger sites) or poke around in your files and database – which I shall show you how to do now.

The exporting and changing SQL that I’m about to show you will be demonstrated for moving attachments, but you can also use a similar methodology to transfer the whole database across. This is useful if you want to transfer everything but your XML file is too large to upload through the importer.

1. Select the Content You Want to Export

Venture once more to the Tools > Export screen to begin with.

Export screen with posts selected.
Here I have chosen to export only posts after mid-2010 from a certain author. You can also choose to export by status (eg. Published, Pending, Draft) or their Category. Other content types like pages (or Feedback, Portfolio, etc. if enabled) can be selected.

Once you’ve selected which content you’d like to export, click Download Export File as before. If there are multiple selections you’d like to make (eg. two authors’ posts in a date range, or someone’s posts and all pages), it’s entirely possible to go back and create multiple export files for each selection.

2. Import as Before

After you have all the WXR XML files you want, go to the new site and install the WordPress Importer as previously shown. You can upload your files (one at a time) as before and they’ll install the specific posts/pages/other content onto the site.

However, this is not the end, because you’ll notice that you still don’t have any attachments (eg. uploaded images) on your installation quite yet.

3. Duplicate Media Files

Go to your old installation’s FTP client and find the /wp-content/uploads/ folder. I’m using Windows 10’s File Explorer as my FTP client, but most should be able to compress files and download them.

Sending to compressed (zip) file.
Depending on your FTP client, compressing all folders within your uploads directory into a .zip file will be done through different methods.

Download the .ZIP file you generate and upload it to your new site’s FTP (or cut and paste it if you can access both sites through your FTP client).

Moving uploads .zip.
I’m cutting and pasting my compressed uploads across, but you can download and upload if you need to change between FTP clients.

You can then extract all the files from the compressed folder into the Uploads directory.

Unfortunately, that’s not the end of it; while your files are in the right place, your WordPress installation won’t know about them because the attachment details haven’t yet been copied across from the database.

No media attachments found.
Your new WordPress database doesn’t know about the files you’ve uploaded to the new server yet.

4. Export Attachment Posts

Head over to your old site’s phpMyAdmin database and find the wp_posts table (replace wp_ with your prefix as necessary).

wp_posts table SQL.
Again, I used wpmudev_exportposts, but replace the table name with the right prefix as applicable to your database.

At this point, you need to find the attachment posts (those are the media posts) so paste in the following SQL (changing the table name to have the right prefix if necessary) and hit Go.

SELECT 
 * 
FROM 
 `wp_posts` 
WHERE 
 `post_type` = "attachment"
Executed SQL query.
The SQL query will return only attachment posts.

Scroll to the bottom of the query results and check Show all so all attachment posts are showing. Once all rows are displayed, choose Check All then click Export.

At this point, things get a bit more complicated, but stay with me and follow the steps carefully and you should be fine.

Custom wp_posts Export with Format Specific Options
For the purposes of the picture, the options you’ll need to change have been moved up the page. You may need to scroll down to find them.
  1. Choose Custom to show all possible settings.
  2. Scroll down to the Format-specific Options section.
  3. Choose data.
  4. Leave everything else as it is and click Go.

5. Edit Your SQL

This step is necessary if your new installation has a different database prefix to the one from which you’ve just downloaded your SQL export file.

Edit the .sql file using a text editor such as Notepad++, finding and replacing the old prefix with the new prefix.

Find and replace prefixes in SQL file.
In my case, my original database was prefixed wpmudev_export and the one to which I will be moving the attachments is prefixed wpmudev_import!

If your prefixes are the same (eg. both tables are wp_posts), that’s fine and you can ignore this step.

6. Import Attachment Posts

wp_posts Import Page.
As ever, find the table with the right prefix as applicable!

Go to your new database and find wp_posts (or equivalent); click Import.

Click Choose File – make sure you click, don’t drag it in, as this means it won’t be uploaded in the right place – and select the exported SQL file.

Leave all other options as they are and execute the query by hitting Go. You’ll see a success message once it’s finished and all your attachments will now be visible under Media – although there’s a further step before your images will start showing up properly.

Media library showing just files, no images.
As you can see, none of the images actually show as images…yet!

7. Export Post Meta

wp_postmeta Custom Export Options
Again, the options you need to change are on this picture. You may need to scroll to find them.

Similar to the previous database work, this time find your old installation’s wp_postmeta table and select the Export tab.

Select Custom settings again and choose data rather than structure and data, just as before.

This time, also locate the Data Creation Options heading and select REPLACE as the function to use when dumping data.

Once again, click Go to create and download your SQL file.

8. Edit Your SQL

wp_postmeta SQL file editing

Again, you need to change the prefixes in your SQL file if the new database prefix will be different. You should also find all references to your old URL and replace them with the new one.

9. Import Post Meta

Go to your new wp_postmeta (or other applicable prefix) table and, exactly as before, import your edited SQL file into the new installation.

Your media library is now complete once more, ready to fit back into your transferred content (finally).

Completed Media Library
Finally, all your images show up and can be shown within content!

Finishing Up

If you’ve got through all that, well done – it’s a bit of a roundabout method just to transfer some images across with specific posts.

Of course, there are still catches with this: if you only want to migrate some of the images, you need to go through and pick out the folders (hopefully you want them by date or it would take forever) more carefully when uploading. You could also run into trouble with duplicate primary keys transferring wp_posts if you already had posts on the new installation.

Clearly, to make the Import/Export process more intuitive – rather than requiring such creative thinking with the databases behind the CMS – some work will need to be completed for a future WordPress release. While we wait, however, if you do need to move some of your content, this should work for you – it’s well worth the time!

If you’ve got any more ideas and methods for moving across parts of a WordPress installation with all the content in tow, we’d love you to share it with us in the comments. Likewise, let us know if you’re having any issues with these methods and we can try to give you a hand.

Loading Thousands of Tables in Parallel With Ray Into CockroachDB Because Why Not?

I came across an interesting scenario working with one of our customers. They are using a common data integration tool to load hundreds of tables into CockroachDB simultaneously. They reported an issue that their loads fail intermittently due to an unrecognized error. As a debug exercise I set out to write a script to import data from an http endpoint into CRDB in parallel. 

Disclosure: I do not claim to be an expert in CRDB, Python, or anything else for that matter. This is an exercise in answering a why not? question more so than anything educational. I wrote a Python script to execute an import job and need to make sure it executes in parallel to achieve the concurrency scenario I've originally set out to do. 

ECMAScript proposal: JSON modules

Dr. Axel Rauschmayer looks at JSON modules, which is already live in Chrome 91 (but nothing else). It looks just like an ES Modules-style import, only you asset the type at the end.

import configData from './config-data.json' assert {type: 'json'};

How nice is that? Once this makes its way across browsers, we’ve gone on a journey from “you’ll almost definitely want to use an Ajax library” because of the cross-browser complexity and weirdness of XMLHttpRequest to the much nicer (but you still gotta write some code) fetch API, to a one-liner (if what you need is JSON data).

Snagging some JSON data seems like it should be as easy as a one-liner to me, and now it is. I like how the URL can be dynamic now too.

Direct Link to ArticlePermalink


The post ECMAScript proposal: JSON modules appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

Never Import Messy Spreadsheets Again

You’re probably familiar with the numerous stats dedicated to customer retention. For example, customer acquisition is 5 times more expensive than retention. Providing an exceptional customer experience is critical to keeping customers happy. For most B2B technology companies, this starts with the onboarding process.  

But data onboarding—that critical first step of bringing customer data into a platform—isn’t as well understood or discussed. Fortunately for frustrated software customers everywhere, that’s changing. 

Data onboarding is an emerging category with a big impact: getting your customers to reap value from your product faster and with fewer demands on your internal engineering and customer success teams.

Data onboarding is a problem for companies of all sizes

According to a data onboarding survey that Flatfile recently conducted, 23% of software companies state that it can take weeks or months to import customer data, and 96% reported that they have run into problems while doing so. 

Importing CSV files isn’t enjoyable for the customers prepping them, for the developers building the import function, or for the customer service and success teams fielding constant data import questions. 

CRMs, ERPs, product lifecycle management software, and inventory management software are just a few of the many software categories that necessitate data importing. Without customer data, they’re useless. Unfortunately, importing customer data into these software tools is easier said than done. And a poor data onboarding experience has repercussions.

If an enterprise software provider lacks simple and effective data import capabilities, customer frustration and churn could be the result. In addition, companies typically waste precious time and resources having internal teams format spreadsheet errors, fix validation problems, and generally wrangle spreadsheets on behalf of their customers who are simply trying to import their data.

Companies face a build vs. buy decision for importing data

Importing data is essential to get customers onboarded quickly, gaining value from a software platform. But it turns out that building a high quality data importer is both costly and time-consuming. Essentially, it’s a product in and of itself. 

Your engineering and product teams are busy building out new features that matter to your customers and fixing bugs for critical functionality. Building a data importer is not typically on their growing to-do list.

When companies build their own data importers in house, the inevitable occurs: 

  • The team can’t give a data importer the full attention it deserves so they’re likely to produce something that isn’t intuitive for customers to use and doesn’t offer clear troubleshooting steps when an import fails. 
  • Maintaining a data importer requires ongoing work. Once a data importer is built, there needs to be dedicated resources to update, fix and add new features to the importer.

There is, however, another option. Software companies can choose to buy a data onboarding solution to import data rather than build one from scratch. 

John Baigent, the co-founder of Oversight Software and a customer of Flatfile’s data importer, Portal, says, “We aren’t spending precious time reinventing the wheel in terms of file upload, we’re spending our time developing features that our customers want to see and subsequently make their jobs easier.”

The ROI of a pre-built data importer

Startups like ParrotMob and TableCloth are using Flatfile Portal to solve their data import challenges. Early-stage startups, in particular, shouldn’t waste resources on building and maintaining a data importer. Michael McCarthy, CEO of Inkit describes the potential losses from a poorly built importer. “We had two clients that were paying upwards of $30,000 a year and were at risk to churn if we didn’t figure our data import issue out,” McCarthy says. 

“Without Flatfile, we would have had to dedicate one or two full time engineers to the development and maintenance of an internal data import solution and honestly, it would never have been as good as Flatfile’s product,” says McCarthy. “I could see a bigger company looking at a million dollars a year in cost savings.”

Flatfile leads the emerging data onboarding category

Effective data import is an essential part of a larger category that’s on the rise: data onboarding. 

Successful data onboarding ensures that it’s as easy as possible to bring customer data into a product – whether customers themselves are migrating the data or a customer success team (as part of a white-glove onboarding experience). When data onboarding works, customer onboarding is a whole lot smoother and extensive time is no longer dedicated to asking: did the data import go okay?!

Flatfile is setting a new standard in data onboarding with two innovative business products: 

Thanks to Flatfile, companies of all sizes no longer need to waste time on patchwork solutions like emailing sensitive Excel files, formatting CSV templates, or hiring expensive teams to help onboard customer data.

The post Never Import Messy Spreadsheets Again appeared first on Codrops.

Importing All Your Contact Form 7 Data To Forminator Is Now Possible (And Dead Simple!)

Want to instantly teleport all of your existing Contact Form 7 data over to Forminator? As of release 1.11 it can now be done in a matter of clicks. Stick around to see how it works and why we think you should make the transition.

That’s right, the most popular form plugin on WordPress just got a whole lot easier to ditch completely.

Nothing against Contact Form 7 of course… it’s been a staple in the WordPress community for some years now.

We just reckon our Forminator is a superior (and free) alternative. And we’ll prove it to you later in the article (with facts to back it up!).

But first, let’s get the introductions out of the way for those who haven’t yet met our formidable, form-making plugin.

(*WPMU DEV members and those in the know, feel free to skip this section)

Meet Forminator, Your Personal Website Quiz, Poll, And Form Extraordinaire

Our Forminator plugin does it all! From contact forms, to polls and quizzes

If you’re new around here, Forminator is our own free drag and drop form building plugin for WordPress.

With this intelligent and unassuming superhero by your side you can liven up your site with a plethora of interactive quizzes, polls, and forms.

But here’s the kicker…

Even Though Forminator Is A Free Plugin, It Performs Like It’s Premium!

When it was first released, Forminator changed everything by becoming the first completely free, premium form plugin for WordPress.

So even though he costs you nothing, don’t be surprised to see Forminator going “feature for feature” with the top premium WordPress form plugins out there.

It’s also why we have no issue declaring that Forminator is by far the best freely available form plugin for WordPress.

Because when it comes to constantly innovating and bringing you new and exciting plugin features – Forminator keeps up with the best of the best.

Speaking of new features… let’s get into today’s one.

Just in case you missed it in the title of this article…

Forminator Now Allows You To Easily Import All Your Existing CF7 Site Forms!

Something we figured out early on is that it’s not enough to create a vastly superior plugin.

And it takes more than a host of great features for someone to easily switch from something they already know.

This is especially true in the case of website form plugins.

I mean, who wants to completely re-do all of the forms they’ve already painstakingly set up on their website???

Especially if they’re extensive and you have a number of them.

We Knew We Had To Make It Simpler For Users To Migrate From Contact Form 7 To Forminator

This way they could also have easier access to premium form making features without having to fork out the big bucks, or install 50 other add-ons to get the functionality they desired.

And since you’re reading this article, I can confirm we’ve achieved our mission, so without further ado…

Here’s How Forminator’s New Contact Form 7 Importer Works In WordPress

Before we begin, if you haven’t done so, be sure to install Forminator on your site so you can follow along :)

As mentioned earlier it’s free as a bird to install WordPress.org.

Once you have Forminator open, navigate to “Settings” and then find “Import.”

Next click on “Import” under the Contact Form 7 as shown below.

Forminator makes migrating Contact Form 7 data a breeze

Once you’ve done this, you’ll then see an Import wizard which allows you to import all of your CF7 forms (or specific forms only).

Additionally, you’ll see the list of supported CF7 add-ons where you can select which add-ons you want to import data and settings from.

As well as forms you can also import some Contact Form 7 add ons

Once you’re finished with your selections simply click “Begin Import” to start the import process. This should only take a few seconds to complete.

And just like that you’ve successfully moved all of your existing website forms to Forminator!

Note: Want to skip straight to the action? You might’ve already noticed this cheeky notification on your WP dashboard that takes you straight to the importing process.

We've set up a notfication for you to make importing even easier!

Time to celebrate???

Not quite yet…

Beware Of Unsupported Form Fields And Settings

Look, nothing in this world is perfect, and the same goes for our dear Forminator.

We’re not the kind of company to tell fibs and say everything will be 100% picture perfect when you transition over.

There are some form fields and settings you won’t be able to bring over as Forminator does not support them.

But don’t worry, we have an alternate solution for all of them.

Unsupported CF7 Settings/Form Fields (And How To Get Around Each)

1. Quiz field: Forminator doesn’t have a built-in quiz field. The good news is you can enable Google’s reCAPTCHA v3 and Honeypot protection on your imported forms.

2. ConstantContact: Our plugin doesn’t integrate directly with ConstantContact. However, you can use Zapier integration to send your leads to ConstantContact.

3. reCAPTCHA v3 integration: At this stage, Forminator can’t import your existing reCAPTCHA integration. You can set this up manually on your imported forms once they are transferred.

4. Additional settings: Forminator doesn’t support CF7’s additional form settings. But rest assured our practical plugin comes jam packed with its own useful features!

5. Custom field IDs: Forminator creates a unique ID for each field, and the conditional logic relies on them. However, you can provide a custom CSS class for each field.

So Why Bother Switching To A New Form Plugin?

This is the obvious question to ask yourself before taking this brand new feature for a spin.

After all, why go to the trouble of switching form plugins when you already have contact forms set up and working perfectly on your site?

But just because you’re comfortable using something, doesn’t mean there aren’t better options out there.

And the simple fact is, Forminator does all Contact Form 7 does, and so much more!

Need proof?

Here’s How The Two Form Plugins Stack Up Against One Another:

Forminator and Contact Form 7 go head to head

As you can see, this comparison reads pretty much like any other “premium vs. free” battle would.

The free version usually gives you the basics, but if you want the real meat and potatoes you’ll have to upgrade.

Only In This Case The Meat And Potatoes Are Free!

Also, keep in mind this table compares “form” features only.

We’re not even scratching the surface when it comes to Forminator’s ability to do other things like creating interactive polls and quizzes for your website.

But we’ll save that for another day.

The real point of this article is to simply introduce you to this exciting new feature.

On that note…

What’s Stopping You From Upping Your Form Game?

With the main hindrance of having to start over in order to switch form plugins gone, what’s holding you back now?

Is it the ability to actually collect and track your form stats?

Is it the crazy big integration with 1000+ 3rd party apps?

Is it the 15+ form field options and the option of styling and profiling your soon-to-be-epic website forms?

Is it the ability to add payment processing to your forms without needing an add-on or another plugin?

Surely not! ;)

If there is something in particular you think Forminator could be better at – be sure to let us know.

We’re always looking to improve our plugins, and our dev team won’t stop until Forminator becomes the “go-to” form plugin on WordPress.

Our Goal Is To Provide The Highest Quality Tools For Our Users

And if we thought one of our plugins wasn’t up to the task we’d be the first to suggest another plugin, or one of our partner’s solutions.

Speaking of our team… a special shoutout and thanks to the superheroes behind the scenes who made this amazing new feature possible:

Developer: Cvetan Cvetanov QA: Devendera Mishra Design: Mukul Chawla

Remember, if you want to take the feature mentioned today, as well as all Forminator’s other fantastic premium features for a spin, you can install the plugin for free over on WordPress.org.

Or if you’re really game, you can sign up for a free 30 day trial with WPMU DEV and get instant access to WPMU DEV’s full suite of premium WordPress plugins, as well as 24/7 live support, our new managed hosting, and much more.

Also be sure to check out our Product Roadmap to see what’s on the horizon for Forminator in future updates.