Duplicate/Clone a Multi-site But Use Same Images & Resources?

I'm looking for any advice before taking the step of cloning my main site into a sub-but utilizing the same resources.

Is this an easy process? I realize I can strictly instruct my url paths, but in some circumstances the resources come from the media library and I may have to be more diligent.

Has anyone done this? Is there an easy way about going about it?

Topic duplicates clone-site media-library multisite Wordpress

Category Web


If you have access to a Linux/Mac/Unix command line with bash, you can do the following:

  • Export your database to an SQL file.
  • Use sed command with -E to run regex search and replace operations on URLs that do not contain wp-content/uploads (or whichever folder contains your media)
  • Import your SQL file to the new server.

The one "gotcha" would be the regular expression required to exclude your media folder.

If you do NOT have access to bash, or do not have strong regex experience, you might review the WPBeginner article How to clone a Wordpress Site in 7 Easy Steps. A friend of mine has used their method several times.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.