# Migrating an existing WordPress site to Ruachost

> Move an existing WordPress site to Ruachost by transferring the files and database, updating wp-config.php and pointing your domain.

Source: https://helpcenter.ruachost.com/wordpress/guides/how-to-migrate-an-existing-wordpress-site-to-ruachost-com/

If you already have a WordPress site hosted elsewhere, you don’t need to start over. You can migrate your existing site to **ruachost.com** by transferring files, databases, and settings. This ensures your site remains intact with all posts, themes, and plugins.

## Migration Overview

To migrate successfully, you’ll need to:

1. Transfer WordPress files.
2. Export and import the WordPress database.
3. Configure custom settings.
4. Update domain settings.
5. Test the new site.

## Step 1: Migrate WordPress Files

- ### Using cPanel

  1. Log in to cPanel on your current host.
  2. Compress the WordPress directory (usually `public_html`) into a `.zip` file.
  3. Upload the `.zip` file to your **ruachost.com** account via File Manager or FTP.
  4. Extract the files into the `public_html` directory.
- ### Using Command Line (SSH)

  1. Log in via SSH to your old host.
  2. Run:

     ```bash
     zip -r public_html.zip public_html
     ```
  3. Upload the `.zip` file to your **ruachost.com** account.
  4. Extract with:

     ```bash
     unzip public_html.zip
     ```

## Step 2: Migrate the Database

- ### Export Database from Old Host

  1. Open `wp-config.php` to identify your database name.
  2. Use phpMyAdmin → Export → Save as `wordpress.sql`.
- ### Import Database to Ruachost.com

  1. Log in to cPanel at **ruachost.com**.
  2. Create a new MySQL database and user.
  3. Use phpMyAdmin → Import → Upload `wordpress.sql`.
  4. Update `wp-config.php` with new database credentials:

     ```
     define('DB_NAME', 'new_database');
     define('DB_USER', 'new_user');
     define('DB_PASSWORD', 'new_password');
     ```

## Step 3: Configure Custom Settings

- Copy or update any custom settings from `.htaccess` or `php.ini`.
- Ensure plugins and themes are compatible with the new environment.

## Step 4: Update Domain Settings

- Point your domain’s **nameservers** to **ruachost.com**.
- If using a new domain, update the `siteurl` and `home` values in the WordPress database (`wp_options` table).

## Step 5: Test the Site

- Visit your domain to confirm the site loads correctly.
- Test posts, pages, and admin login.
- Clear cache if changes don’t appear immediately.

> **Note:**
- Always back up your site before migration.
- If migrating to a subdirectory, include it in the domain URL (e.g., `example.com/blog`).
- Consider enabling caching and CAPTCHA protection after migration for performance and security.
