• I got a production website using WordPress. But I want to revamp it. It seems enabling a multi-site option is not a good idea, as at the end, I got only 1 site. But I want to have a temporary site which can use the current production site as a base to be changed to the new one. It will take a few months before I complete, so the existing and new sites need to be accessible at the same time (can be in different path, best if the new one is not accessible by others). Also, I want to see if possible to copy a set of existing posts for the new site, so that I can modify them for the new site (rather than copy and paste one by one). I prefer not to refer to the same set of posts for both sites as I likely need to modify content, while the old content should still be used on existing site until I switch over to new one.
    Any recommendation on how I can achieve all above? Please advise. Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The best way to do that (imo) for a few months would be by having a local WordPress installation inside Xampp, WAMP, MAMP or whatever there on your own computer…
    https://www.google.com/search?q=Xampp+WAMP+MAMP+wordpress
    …but you certainly also have the option of adding a sub-folder inside your current public “root” folder (public_html in my own case) and adding a separate WordPress installation there and using mydomain.com/subfolder to access it. You would want to set it to “Discourage search engines…” to help avoid trouble over duplicate content, and you could add password protection to keep anyone who might find it from viewing or entering.

    In either setup, you would use phpMyAdmin on each end to export/import database tables and run some SQL code for updating the location URL after doing an import. However, the biggest complication in all of this would be the matter of keeping the two sets of uploads in sync. So, I typically only do media uploads at the “live” site and then manually fix the broken links in my local installation so its database can tell WordPress where to find them.

    Thread Starter samchang1130

    (@samchang1130)

    Thanks for the suggestion. It means I can install another copy to separate folder (I bet manually) and copy the database to new one (hope I can find out how), then I can have both old and new sites running in parallel. After I finish the change, is it better to just point the domain to the new site and delete the old one, or copy the new database back to original one? The uploads seems to affect which one is better. But if I want to regroup the uploads (mainly pdf and images), is it better to copy them as well to new site, do the change, and just point the domain to here? Pls advise if it is possible. Thanks.

    Thread Starter samchang1130

    (@samchang1130)

    One more question. No matter having a local copy in my computer, or another installation on server, do I need to use exactly same version of WP for both so that I can backup and restore the database?

    I can install another copy to separate folder (I bet manually) and copy the database to new one (hope I can find out how), then I can have both old and new sites running in parallel.

    Yes, a manual installation is what I would do, then either go to cPanel > MySQL and add a new database and user or else just a new user if you might want the new site to use the same database (container) by simply adding another set of tables (cloned from the first) to the existing database…

    original database > original user > original tables
    original database > new user > cloned tables

    To make a set of cloned tables for the new site to simply add to the existing database, first download a backup of the existing tables, then use a plugin such as BulletProof Security to change the table prefix for the original site, then copy a backup of that site’s wp-config.php and set it aside for the new site, then import the backed up tables into the original database and change the original site’s wp-config.php back to the original table_prefix, then add the new user to the backed up wp-config for the new site and I believe it will be good-to-go!

    After I finish the change, is it better to just point the domain to the new site and delete the old one, or copy the new database back to original one?

    I do not know either way as better, but simply redirecting (not re-assigning or re-pointing) the domain to the new site is definitely simplest:

    ## from https://my.bluehost.com/cgi/help/347#redirect
    # .htaccess main domain to subdirectory redirect
    # Do not change this line.
    RewriteEngine on
    # Change example.com to be your main domain.
    RewriteCond %{HTTP_HOST} ^(www.)?example.com$
    # Change 'subdirectory' to be the directory you will use for your main domain.
    RewriteCond %{REQUEST_URI} !^/subdirectory/
    # Don't change the following two lines.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    # Change 'subdirectory' to be the directory you will use for your main domain.
    RewriteRule ^(.*)$ /subdirectory/$1
    # Change example.com to be your main domain again.
    # Change 'subdirectory' to be the directory you will use for your main domain
    # followed by / then the main file for your site, index.php, index.html, etc.
    RewriteCond %{HTTP_HOST} ^(www.)?example.com$
    #RewriteRule ^(/)?$ subdirectory/index.html [L]
    ## index.php for WordPress
    RewriteRule ^(/)?$ subdirectory/index.php [L]

    The uploads seems to affect which one is better.

    I do not know what you mean by that, but I do know the location of the installation makes no difference.

    But if I want to regroup the uploads (mainly pdf and images), is it better to copy them as well to new site, do the change, and just point the domain to here?

    You cannot simply move files around manually and then expect the database to know where to tell WordPress to find them, but yes, redirection is simplest after everything is set.

    One more question. No matter having a local copy in my computer, or another installation on server, do I need to use exactly same version of WP for both so that I can backup and restore the database?

    I recently updated a local installation of WordPress where I switch from site to site by merely changing the table_prefix in wp-config…and then each time I did that to “switch sites”, I received the “WordPress needs to update your database” notice for each site even though the tables for all sites are in the same database. So, the answer to your question is related to whether or not the latest WordPress update also did a database update, and I do not know what would happen if an older version of WordPress tried to use an updated database.

    Thread Starter samchang1130

    (@samchang1130)

    After knowing more, my intended plan is:
    – full backup of the site (hope it can include all images and pdfs);
    – build a local copy of WP in my PC and restore everything there;
    – change the site, including new theme, new plugins, restructure folders/navigation, rephrase some posts (and try not to touch image/pdf as I still don’t understand the impact);
    – backup the database and restore on the production site.

    I try not to require to write SQL and update database directly if possible (not sure if I can do it correctly and completely). The most concern is whether the last step (backup/restore database) is good enough to reflect all changes intended. If not, what I can do is best? Pls advise. Thanks.

    – full backup of the site (hope it can include all images and pdfs);

    For site backup, you need a copy of your database, /wp-content/ (folder and contents) and a copy of wp-config.php.

    – build a local copy of WP in my PC and restore everything there;

    After adding a fresh download of WordPress inside Xampp, WAMP, MAMP or whatever and getting that running, you would add the above and then edit your database and wp-config.php to match.

    – change the site, including new theme, new plugins, restructure folders/navigation, rephrase some posts (and try not to touch image/pdf as I still don’t understand the impact);

    Anything you might change in the uploads folder (images, PDFs, etc.) is fine as long as you do that only through the WordPress Dashboard to keep the database informed and not by moving things around manually outside of WordPress.

    – backup the database and restore on the production site.

    That would actually be the database and the /wp-content/ folder.

    I try not to require to write SQL and update database directly if possible (not sure if I can do it correctly and completely).

    Any time you move a database from one server to another, it must be updated so it can know the incoming URL and the location of the installation.

    The most concern is whether the last step (backup/restore database) is good enough to reflect all changes intended.

    Always keep the database and /wp-content/ together and all will be well as long as all changes are made properly.

    Thread Starter samchang1130

    (@samchang1130)

    Thanks! Will try

    Thread Starter samchang1130

    (@samchang1130)

    Hi, finally have time to try it. Got the site up and running in local PC already. The only thing I found it odd is that now no matter the site or the WP admin, the path is under 127.0.0.1/wordpress/. What I need to change in order to make all pages sit under docroot ‘127.0.0.1/’?

    For the host name, I suppose I only need to add an entry into the hosts file somewhere. I try not to do it at the moment, as I still need to refer to the public production site from time to time and setting it, so that it is exactly the same as production one, is troublesome for day to day operation. Is there easy way to handle it?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Website revamp’ is closed to new replies.