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?
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?
Share Improve this question asked Aug 29, 2019 at 21:17 Bruce BannerBruce Banner 11 Answer
Reset to default 0If 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 containwp-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.