1. Select only certain tables (each site has its own table prefix e.g. wp_3_*):
mysql -p -N information_schema -e "select table_name from tables where table_schema = 'wordpress_multisite' and table_name like 'wp_3_%'" > tables.txt
Put all names on single line:
cat tables.txt | xargs > table_oneline.txt
Multisite WP has 2 tables where the user info is kept for each site. They need to be renamed and added to DB for each site. Add this to table_oneline.txt
rename table `wp_usermeta` to `wp_3_usermeta`; rename table `wp_users` to `wp_3_users`;
Dump:
mysqldump -p wordpress_multisite `cat table_oneline.txt` > wpexport.sql
2. Import on new server with
mysql -u root -p wettshop < wpexport.sql
3. Replace old strings with new ones using the wp-cli tool
wp search-replace 'http://example.com' 'http://example.org' --allow-root wp search-replace 'http://example.com/wp-content/uploads/sites/3/' 'http://example.org/wp-content/uploads/' --allow-root
4. To access the admin site, choose some user from DB and change their password
update wp_3_users set user_pass = MD5 ('KbGmM7cm7QuGras') where id = 1;
See this schema how the folders should look like]]