Moving or restoring a website for beginners: don't be afraid, it's easier than it seems

Published on 2025-10-05

Moving or Restoring a Website for Beginners: Don’t Be Afraid, It’s Easier Than It Seems

Moving a website to a new server or restoring it after a failure can sound like a scary task, especially if you’re new to web development or administration. But don’t panic. With the right approach and a step-by-step plan you can handle it without stress. Below is a breakdown of the whole process: from backup to functionality checks, including ISPmanager and FreePanel panels and local testing via hosts without changing public DNS.

What is moving and restoring a website

Moving a website — transferring all files, databases and settings from one server (or hosting) to another. You need this if you:

  • change hosting providers (price, performance, limitations),
  • move from a local server to production,
  • upgrade the server (outdated software/hardware).

Restoring a website — returning the site to working order after a failure, hack or accidental deletion. Usually done from a backup.

The goal is to understand the process and avoid common mistakes. The examples below are aimed at WordPress and static sites, but the principles are universal.

Why it’s not scary

The fear of “breaking everything” goes away if you:

  1. make a backup before starting,
  2. follow a clear plan,
  3. check each step.

Step 1. Preparation and backup

Why it matters. Without a backup you risk losing data forever. Even if everything works — make a copy.

What to save

  • Site files: HTML, PHP, CSS, JS, images. On servers often: /var/www/html or ~/www/public_html.
  • Database: MySQL/MariaDB (often for WordPress).
  • Configurations: .htaccess (Apache), Nginx virtual hosts, PHP settings.
  • DNS settings: A, CNAME and other records at the registrar/DNS provider.

How to make a backup

Files:

  • via FTP/SFTP (e.g., FileZilla) — download the site folder;
  • via SSH — create an archive and then download:
tar -czvf site-backup.tar.gz /var/www/html

Database (MySQL/MariaDB):

mysqldump -u username -p database_name > backup.sql

Hosting panels: ISPmanager and FreePanel have DB export from the interface.

WordPress: plugins like UpdraftPlus or Duplicator create a full backup (files + DB).

Tip. Keep a copy off the original server: external drive, cloud (Google Drive, Dropbox), another server.


Step 2. Preparing the new server

If moving — prepare the new server. If restoring — bring the current server to order.

Install software (Ubuntu example):

sudo apt update
sudo apt install apache2 php libapache2-mod-php mysql-server

Alternative: Nginx + PHP-FPM.

Access and networking

sudo apt install openssh-server
sudo ufw allow 80
sudo ufw allow 443

Create DB and user (MySQL):

CREATE DATABASE new_database;
CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON new_database.* TO 'new_user'@'localhost';
FLUSH PRIVILEGES;

Step 3. Transferring or restoring data

Transferring files

Via SFTP/FTP — upload the contents to the site root on the new server (often /var/www/html). Via SSH:

scp site-backup.tar.gz user@new-server-ip:/var/www
ssh user@new-server-ip
sudo tar -xzvf /var/www/site-backup.tar.gz -C /var/www/html
sudo chown -R www-data:www-data /var/www/html
sudo find /var/www/html -type d -exec chmod 755 {} \;
sudo find /var/www/html -type f -exec chmod 644 {} \;

Restoring the database

mysql -u new_user -p new_database < backup.sql

WordPress: update wp-config.php (DB name, user, password, host).

Web server configuration

Apache Check .htaccess. Basic one for WordPress:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Nginx Example virtual host:

server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;
    root /var/www/html;
    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass unix:/run/php/php8.2-fpm.sock; # проверьте версию PHP-FPM
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_index index.php;
    }
}

Restart:

sudo systemctl restart apache2
# или
sudo systemctl restart nginx

Step 4. Updating DNS when moving

  1. In the panel at your registrar/DNS provider change the A record to the new IP.
  2. A day before migration lower the record TTL to speed up propagation.
  3. Expect 1–24 hours for propagation.

Step 5. Local testing via hosts

Test before changing public DNS. Users won’t see the changes.

Editing hosts

  • Windows: C:\Windows\System32\drivers\etc\hosts
  • Linux/macOS: /etc/hosts

Add a line:

192.168.1.100 yourdomain.com www.yourdomain.com

Where 192.168.1.100 is the IP of the new or local server.

Flush DNS cache

  • Windows:
ipconfig /flushdns
  • macOS:
sudo dscacheutil -flushcache
  • Linux (systemd):
sudo systemd-resolve --flush-caches

Open http://yourdomain.com — requests will go to the specified IP. After testing remove the line from hosts and flush the cache again.

Locally on the server Add to /etc/hosts:

127.0.0.1 yourdomain.com

Check:

curl -I http://yourdomain.com

If you use ISPmanager/FreePanel — add the domain in the panel and set the site root folder.


Step 6. Checking the site

Access and functionality

  • Open the site by domain/IP.
  • Go through pages, forms, media.
  • WordPress: log in at /wp-admin.

Logs

# Apache
tail -f /var/log/apache2/error.log

# Nginx
tail -f /var/log/nginx/error.log

Database Check that content displays correctly.

HTTPS

sudo apt install certbot python3-certbot-apache
sudo certbot --apache
# или для Nginx:
# sudo apt install certbot python3-certbot-nginx
# sudo certbot --nginx

Moving using ISPmanager

Backup

  • Log into the panel (https://<ip>:1500).
  • “File Manager”/“Backup”: archive and download the site folder (/var/www/<user>/data/www/yourdomain.com).
  • “Databases”: export .sql.
  • Note domain settings and PHP version.

Transfer

  • On the new server upload the archive and unpack it to the target folder.
  • Create DB and user, import .sql.
  • In “Domains” add the domain, set the site root, PHP version.
  • In “SSL Certificates” connect Let’s Encrypt or upload your own.

Note. ISPmanager automatically writes Apache/Nginx configs, but check owner/permissions (usually 755 for folders, 644 for files).


Moving using FreePanel

Backup

  • Log in (often http://<ip>:8080).
  • “File Manager”: download the site folder or make an archive:
tar -czvf site-backup.tar.gz /var/www/html/yourdomain
  • “Databases”: export .sql or via SSH mysqldump.

Transfer

  • On the new server in “File Manager” upload the archive and unpack:
tar -xzvf site-backup.tar.gz -C /var/www/html/yourdomain
  • Create DB and user, import:
mysql -u new_user -p new_database < backup.sql
  • “Domains”: add the domain, site root, PHP version.

SSL If auto-Let’s Encrypt is not available:

sudo certbot --apache
# or:
# sudo certbot --nginx

Note. FreePanel requires more manual work. If problems arise check configs in /etc/apache2 or /etc/nginx and permissions.


Common problems and quick fixes

  • Database connection error — check wp-config.php (DB_NAME/DB_USER/DB_PASSWORD/DB_HOST).
  • 404 on WordPress — recheck .htaccess (Apache) or try_files in Nginx.
  • White screen — enable debugging:
define('WP_DEBUG', true);

and watch web server logs.

  • Slow loading — check that DNS already points to the new IP and there’s no mixed static content from the old server.

  • Missing files — compare the archive contents and the target folder.

  • Panel issues

    • ISPmanager: domain bound to the correct folder, PHP version matches.
    • FreePanel: permissions/owners and correctness of configs manually.
  • Local testing not working — ensure the correct IP in hosts and flush DNS cache.


Helpful tips

  • Test on a subdomain test.yourdomain.com.
  • For WordPress use migration plugins (Duplicator, UpdraftPlus).
  • Set up regular backups (cron or panel tools).
  • Document steps, logins and config changes.

Conclusion

Moving or restoring a website is an achievable task. With a backup and a clear plan the risk is low. Panels like ISPmanager and FreePanel simplify routine tasks, and testing via hosts lets you verify everything without changing public DNS. Take steps sequentially, check logs and don’t keep the only copy on the source server. Over time you’ll perform these operations confidently.

Related reviews

I want to express my deep gratitude to the specialist who set up SEO-friendly URLs for me on OpenCart. Configuring them turned out to be easy and simple, and I'm glad I finally found a professional who did everything well and without unnecessary complications. Before this I went through four specialists, and each time there were issues with the setup, but this person handled the task perfectly.

apande

apande · Configuring Nginx and OpenCart

A very powerful buyer

2024-09-07 · ⭐ 5/5

I want to express my great gratitude to the specialist who configured SEO-friendly URLs for me on OpenCart. Setting up the URLs turned out to be easy and simple, and I'm glad that I finally found a professional who did everything efficiently and without unnecessary complications. Before that I changed four specialists, and each time there were problems with the configuration, but this person handled the task perfectly.

I needed to resolve an SSL certificate issue on a server where the certificate had been issued through Nginx Proxy Manager. Mikhail clarified all the details of my setup and requested access to assess the feasibility of solving the issue, since he hadn't worked with that service before. He quickly figured it out and fixed my problem. Perfect cooperation)

kireevk

kireevk · Diagnosing Nginx Proxy Manager in a Docker container and resolving the issue

Settled-in customer

2024-03-15 · ⭐ 5/5

I needed to solve an issue with an SSL certificate on the server that was issued through Ngnix Proxy manager. Mikhail clarified all the details of how everything is set up for me, asked for access to assess the feasibility of solving the issue, since he had not encountered such a service before. He quickly figured it out and solved my problem. Perfect cooperation)

Need help?

Get in touch with me and I'll help solve the problem

Related Posts