WordPress multisite to wordpress singelsite (Easy linux)

So i hade to slip up my wordpress multisite to singel sites and it was not that hard when i found out how.
First start with setting up the new wordpress and then we migrate over the old wordpress site into the new.

1. Setup the new wordpress site
Install and setup the new wordpress site. You can run the instalation we will clean out the instalaltion later.

2. In the old multisite find the site id. It will be a number like 1 ore 2. When you are in network admin and site check the links when you hold the mouse over i link and look for the digits 🙂

3. Migrate all the themes and data into the site. Copy wp-content from the old into the new and give it the correct permissions.
then go in the old wp-content/sites/YOUR SITE ID/ and copy the content in there to the new site wpcontent/upload

Now we have all the files from the old wordpress multisite inti the new wordpress singel site

4. SQL get the databas

1. In the old server run a mysqldump database > databas.sql

Now we have i sql dump with the wordpress multisite

Then run the following sed to fix the sql dump to be ready.

#This will move the standard tables away
sed -i ‘s/wp_commentmeta/wp_com2/g’ databas.sql
sed -i ‘s/wp_comments/wp_comments2/g’ databas.sql
sed -i ‘s/wp_links/wp_links2/g’ databas.sql
sed -i ‘s/wp_options/wp_options2/g’ databas.sql
sed -i ‘s/wp_postmeta/wp_postmeta2/g’ databas.sql
sed -i ‘s/wp_posts/wp_posts22/g’ databas.sql
sed -i ‘s/wp_term_relationships/wp_rs22/g’ databas.sql
sed -i ‘s/wp_term_taxonomy/wp_ta22/g’ databas.sql
sed -i ‘s/wp_terms/wp_terms22/g’ databas.sql

#This will move the site tables into the base
sed -i ‘s/wp_13_/wp_/g’ databas.sql ENTER YOUR SITE IT HERE

Then install the sql into you new database in the new wordpress installation

mysql database < database.sql And now you will have your old multiwordpress site as a singel site