MigrationDNSDatabase7 min read

Migrate your website to Baires Host

Complete migration process: files, database, emails and DNS change without downtime.


Migration overview

Migrating your website involves four main steps: backing up from the old host, uploading to Baires Host, importing the database, and switching DNS.

Step 1: Backup from your current host

Files

Download all your website files:

bash
# Via SSH on old server
cd /home/user/public_html
tar -czf ~/site-backup.tar.gz .

Or use cPanel File Manager → select all → Compress → download the zip.

Database

Export your database:

bash
# Via SSH
mysqldump -u username -p database_name > ~/database-backup.sql

Or via phpMyAdmin → select database → ExportGo.

Email accounts

Note down all email accounts and their passwords. If you use email forwarding or filters, document those too.

Step 2: Upload files to Baires Host

Via cPanel File Manager

  1. Log in to your new cPanel at Baires Host
  2. Go to File Managerpublic_html
  3. Click Upload and upload your backup archive
  4. Right-click the archive → Extract

Via SSH/SCP (faster for large sites)

bash
# Upload from your local machine
scp site-backup.tar.gz user@NEW_SERVER_IP:~/

# SSH into new server and extract
ssh user@NEW_SERVER_IP
cd ~/public_html
tar -xzf ~/site-backup.tar.gz

Step 3: Import the database

Create the database in cPanel

  1. Go to DatabasesMySQL Databases
  2. Create a new database
  3. Create a new user
  4. Add user to database with All Privileges

Import the data

Via phpMyAdmin:

  1. Go to DatabasesphpMyAdmin
  2. Select your new database
  3. Click Import → choose your SQL file → Go

Via command line (for large databases):

bash
mysql -u username -p database_name < database-backup.sql

Update configuration files

Update your application's database connection settings:

WordPress (wp-config.php):

php
define('DB_NAME', 'new_database_name');
define('DB_USER', 'new_database_user');
define('DB_PASSWORD', 'new_password');
define('DB_HOST', 'localhost');

Laravel (.env):

env
DB_DATABASE=new_database_name
DB_USERNAME=new_database_user
DB_PASSWORD=new_password

Step 4: Test before switching DNS

Verify your site works on the new server before changing DNS:

Edit your local hosts file

On your computer, temporarily point your domain to the new server:

Windows: C:\Windows\System32\drivers\etc\hosts

macOS/Linux: /etc/hosts

Add:

terminal
NEW_SERVER_IP yourdomain.com
NEW_SERVER_IP www.yourdomain.com

Browse your site and verify everything works. Remove these entries after DNS switch.

Step 5: Switch DNS

Once everything is verified:

  1. Update nameservers at your registrar to:

```

ns1.baires.host

ns2.baires.host

```

  1. Or update A records to point to your new Baires Host IP

Tip: Lower your TTL to 300 (5 minutes) a day before migration to speed up propagation.

Step 6: Install SSL certificate

After DNS propagation:

  1. In cPanel → SecuritySSL/TLS Status
  2. Run AutoSSL for your domain
  3. Enable HTTPS redirect

Step 7: Recreate email accounts

  1. Go to cPanel → EmailEmail Accounts
  2. Create each email account with the same addresses
  3. Update email client settings with new server details

Post-migration checklist

  • All pages load correctly
  • Forms submit successfully
  • Images and media display properly
  • SSL certificate is active
  • Email sending and receiving works
  • Cron jobs are recreated
  • Redirects are working
  • Remove hosts file entries from your computer

Minimize downtime

  • Migrate during low-traffic hours
  • Lower DNS TTL 24-48 hours before migration
  • Keep the old hosting active for a few days after DNS switch
  • Monitor for any 404 errors in the first 48 hours

Was this guide helpful?