How to move a website to a different directory

Every website is linked to a certain htdocs directory on your account. But sometimes you need to move a website from one htdocs directory to another. This may be necessary if:

  • You are moving to a different domain name (e.g. a free subdomain to a custom domain).
  • You have recreated your domain name and it was assigned to a different directory.

Fortunately, there is no need to rebuild your website from scratch. It’s not difficult to move your website from one directory to another.

How to move a directory

There are two ways to move your website files. You can move the files to the new location, which is the fastest way, or you can copy the files to the new location, which is safer but a lot slower.

Moving an htdocs directory

The fastest, and pretty safe method to transfer your website is by moving the entire htdocs folder. If done correctly, there is no risk of data loss, and it’s nearly instant.

1. Remove the new htdocs directory

Open the file manager for your hosting account, and go to the directory of your NEW domain. Right click the htdocs folder and click Delete.

This will delete the (empty) htdocs folder of the new domain, because we will replace this with the directory that has your website files.

2. Cut the old htdocs folder

Now we go to the location where your old htdocs folder lives. This can be the folder of your previous domain name, or the root folder.

Right click this htdocs folder, and click Cut.

3. Paste the htdocs folder in the new directory

Now go back to the folder where the files should be moved to.

In this folder, click anywhere in the empty space, and choose Paste.

That’s it!

Within a second, the htdocs folder will pop up in the new location, with all your website files!

Copying a htdocs directory

If you want to be absolutely sure your files are safe, or you simply want the files to be on both websites, you can also copy the files of your website.

Note beforehand

The first thing to be aware of is that FTP does not support copying files. So the only way to “copy” files is to download them from the old location and upload them to the new one.

Also, please note that the file manager is also just an FTP client. So for the file manager to copy your website, the file manger has to download and re-upload every single file. Also, the file manager is pretty bad at large file transfers.

In other words: you have to use a desktop FTP client, like FileZilla, for this.

Finally, please be aware that copying your website means you will double the disk usage and inode usage. Depending on the size of your website, this may push you over the limit, which will cause the upload to fail.

How to copy a htdocs directory

To copy the files of your website, you can simply download the htdocs directory of the site to your computer first. Then, upload the contents of that htdocs directory to the new directory on your account.

Tips

Set up a redirect on the old domain

If you’re moving from one domain to another, instead of deleting the old domain, you can also setup a redirect to direct traffic from your old domain to your new domain.

To do so:

  1. If you moved the directory from your old domain, create a new directory with the name htdocs in the location where you moved it from.
  2. In the client area, find your account, and go to the Redirects menu.
  3. Create a new redirect for the path /, pointing to your new domain. You’ll want to choose the “301 Permanent” type for this.

Use the Parked/Alias Domains functionality

If you’re moving to a different domain name, and your new domain is a custom domain, you can avoid having to migrate files to begin with.

Instead, when creating your domain, you can set it up as a Parked Domain (control panel) or Alias Domain (client area).

By doing this, you can link your new domain name to the same htdocs directory of your old domain. This with, both your new domain and your old domain will have the same files and show the same website.

You can safely delete the old domain after the new domain has been set up as Parked Domain. But once the old domain is deleted, there is no way to link a different domain to the same directory!

You may need to change additional settings

The steps above describe how to migrate the files of a website. However, this may not be the only thing you need to do.

If you’re migrating to a different domain name, you will likely have to change some settings to update your website URL. How to do this, or whether this is needed at all, depends on your website. For example, for WordPress, you can see this guide: Migrating WordPress – Advanced Administration Handbook | Developer.WordPress.org

In some cases, you will also need to update settings if the directory of your site has changed. However, most websites do not need additional configuration for this.

14 Likes
Error! My website is not loading
Wordpress website migrate
403 forbidden error
Domain wuaze.com suspended, subdomains down
Wordpress website migrate
Configuring Custom DNS with Cloudflare
How to remove the subdomain?
Change free domain name to purchased name
I can't access my admin dashboard and website after domain redirect
Transferring the website from one domain to another
Transferring the website from one domain to another
My website addon domain
How do I move my website from a sub-domain to a new a registered domain
Since this morning my website admin URL is not working, when I click on the URL it shows 404, Websi
Poiting domain to squarespace
Website not loading after changing domain
Domain 000.pe Suspended by Registry
Need Help: Domain Shows IONOS Default Page Despite Setup
Custom Domain Not working
I need to change the wordpress installation domain
Relivephysio.free.nf
My domain doesn't work
Issue with Custom Domain Showing as Parked Domain
External domain connection, please help
Problem with forwarding
Connecting domain
Site Appears Blank After Re-enabling Subdomain on InfinityFree - How to Restore?
Im trying to export to new domain
Imposible access to my site
Assistance Required for Custom Domain Connection and Website Access
Connect domains
404 error
Can I change my domain to another one?
How do I add parked domain from InfinityFree to Custom
Sir mera ek domin raiganjboiask.rf.gd a delete ho gaya restore kar dijiye please19/03/2025 ka kar d
I am using InfinityFree $0 package
Cambio de dominio, uno caducado y eliminado, por uno nuevo
Regarding domain aliases
Cannot access my website
Changing domains
Migartion From free domain to custom domain
change the domain to my website
How do I transfer my domain?
How do I transfer my domain?
Change of domain name
Site [waltermazar.epizy.com] suspended, with conflicting domain status
Hello, I created a MySQL Database from the control panel, with the following details: Hostname: sq
Need Help With Add Domain!
Suspended domain migrate to new domain
All infy.uk subdomains down - suspended by registry
All infy.uk subdomains down - suspended by registry
Domains blocked issues
All infy.uk subdomains down - suspended by registry
All infy.uk subdomains down - suspended by registry
All infy.uk subdomains down - suspended by registry
404
Delete subdomain to add another subdomain for current website but It can't work anymore
Help with hosting account and parked domain
Can't access site
I want use a different name for my website on infinityfree
SSL Installed but not found/active
Issue with existing website
404 error
Wordpress website migrate