Moving site to a different user on same server

I have got to think this has been asked and answered but I’ve been unable to find it – sorry.

Before I start with trial and error I want to do a little thought experiment and get some feedback.

The task is to move a site from my shell account/homedir to a new, different one that I created with the panel. Here’s what I think I should do:

(1) create a subdomain like running under the new user (done).

(2) login as that user and copy – rsync might do nicely – all the web files from my www dir to this user’s www dir.

(3) search – recursive grep perhaps – throughout folder structure for any hard-coded references to my homedir, and update.

(4) test it with a browser, being careful not to mess with the database too much because I am leaving the MySQL db and connection parameters untouched because I don’t see any need to change them.

(5) if all looks good, go into the panel and change the user under which the production site runs, and do NOT check the “move all the files” checkbox because we’ve done that ourself by hand.

(6) clean up – remove the temporary subdomain.

Does this sound right?

There is incidentally a subdomain that will also need to be moved, and it is running under ssl, as in I suppose it’s basically the same procedure, right?

Thanks very much.

It should be much easier.

Why make it so difficult? If you already have the new user ready, go to Manage Domains and Edit your Fully Hosted Domain. There’s a dropdown menu for “Run this domain under user:” So pick the new user and a checkbox will appear to Move the files to the new user.

I don’t know how the SSL aspect of a domain is handled, so I don’t know if there’s anything special you have to do with the certificate.

Well, there are files under the web document root, and other included files in a parallel directory, and having never done this before I don’t know what the script running behind the panel is going to do with what. I certainly can’t just throw the switch on the production site with the panel and cross my fingers because I know that will definitely result in a broken site — unless the script is uncommonly intelligent.

The steps you listed look good. The only catch is that both sites will be accessing the same database, so it’d be wise to back up the database before you get to step 3.

Well it was a long time ago now, but the outcome was: all good. No issues. Thanks.