How to convert sub to fully hosted domain


#1

I have a sub-domain that was set up a number of years ago when DH limited the number of domains. I now want it to be fully hosted like my other domains. The domain that I want to change has a couple of MySQL DB’s, otherwise it is pretty straight forward. I need to verify the code to be sure, but I don’t think it uses any hardcoded paths - I’m pretty sure they are all relative.

Is there an automated way to do this either via the control panel or other method?

If I just copy the file & folders from
parent directory/subdirectory to
new parent directory
and then just change the domain using the control panel, is there anything else I need to do?

Thanks,
Chuck Roy


#2

If you give us an idea of the scripts you’re using for your site someone here may be better able to offer advice, or even tell you precisely what you’ll need to change if they’ve migrated similar software before.

I’d do it like this:

  1. Setup the Fully Hosted domain so you get a folder mapped in your userspace.

  2. Delete the newly created folder (remember the name).

  3. Do a recursive copy of the sub’s folder into HOME.

  4. Rename the newly copied folder to the foldername you deleted in step 2.

Keep your original sub folder in it’s original location for now, in case things don’t pan out :wink:

In the new domain folder, go through all the config.php, settings.php, etc. checking for any hardcoded paths that might be there. Check the database for similar names (config, settings) for any paths contained in there as well.

By now propagation will be complete and you can test it in your browser.

Good luck with it!

Maximum Cash Discount on any plan with MAXCASH


#3

I’d go a bit like this since I’m lazy:

  1. Set up fully hosted, as sXi recommended

  2. Delete that folder (sounding familiar?)

  3. tar -cvf sub.tar sub.domain.com (creates a backup called sub.tar of your sub.domain.com folder)

  4. mv sub.domain.com domain.com (rename the old subdomain folder to your domain folder that got created in step 1

Caveats:

  1. My step 4 assumes that your subdomain and newdomain are in the same home directory (same FTP user)

  2. Should it blow up, you can restore that backup:

tar -xvf sub.tar (you’ll get your full sub.domain.com folder back)

-Scott