Currently i have a challenge to export/import WordPress Websites from one server to another. In my case the source WordPress Instances are on subdomains, and they have to be migrated into one Multisite WordPress Network. In this article i will show you single wordpress to single wordpress and single wordpress to multisite.
What i won’t do: I won’t use a a plugin to transfer the complete website. The WordPress Sites i have to migrate have different plugins, post types, fields etc. The customer wants to clean up their sites and use as less as possible plugins. If you are migrating a complete single WordPress Site from one to another you look into following tutorial: How to migrate WordPress Website with Duplicator
What are the requirements for this tutorial:
- You must have access to the Hosting Files, either trough FTP or File Manager.
- You must have access to the Database.
Step 1: Download the uploads Folder:
Either with and SFTP/FTP-Account or directly from the File Manager of the Hosting Manager go in to “wp-content/uploads”. If the Site is in a WordPress Multisite Network you can download only the files of the site “wp-content/uploads/sites/4/”

Step 2: Upload the folder to the new Server
Afterwards you can upload this folder to the new destination server, with an SFTP/FTP Client or with the File Manager of the Hosting Manager. Here also keep in mind if it’s a multisite network upload the folder into corresponding site. In my case i exported from single wordpress site “wp-content/uploads” and transferred to new server “wp-content/uploads/sites/5/”
Step 3: Export Database Entries
You won’t see the uploaded files right away, because WordPress saves the informations about those files in the Database, which we haven’t migrated yet. Go into database either with phpMyAdmin or with a Database Client and execute following SQL:
SELECT * FROM `wp_posts` where post_type = "attachment"
The tables prefixes can be different, the default is “wp_”.
In this tutorial i am exporting the result with phpMyAdmin. In the export setting choose only “data” for export.

Then export the metadata of the attachments with following SQL:
SELECT * FROM `wp_postmeta` where meta_key LIKE "%wp_attach%"
Step 4: Import the Database Entries
You can use the phpmyadmin import sql function to import both table rows. Now you should see all attachments in the media section of WordPress admin dashboard.
If you also exporting the Posts, Pages, you should replace the static url of the content. WordPress save the media url as static content in the article. You can use following sql to update all posts which contains old url with the new url. (You can also update “guid” with this sql)
UPDATE wp_5_posts SET post_content = REPLACE(post_content, 'https://test.ddev.site/wp-content/uploads', 'https://test.ddev.site/ef/wp-content/uploads/sites/5');
That’s all 🙂