Moving to WebFaction from Other Hosting Providers

Moving your sites to WebFaction doesn’t need to be an ordeal. The strategies in this section help move many types of sites, with specific recommendations for common tasks, such as moving a WordPress installation or copying a MySQL database.

Moving a Site to WebFaction

While every application is a little bit different, try these common steps to move a site from your previous hosting provider to your WebFaction account.

See also

See Moving a WordPress Site for a more detailed example.

  1. Create an application.

    Common application choices include:

    • Static/CGI/PHP for PHP-based sites
    • Static-only for sites consisting of static HTML, JavaScript, and media files
    • Custom for servers that listen to incoming requests on a port
  2. If applicable, create a MySQL or PostgreSQL database.

  3. Copy your files to the application directory, /home/username/webapps/app, where username is your WebFaction account name and app is the name of the application as it appears on the control panel.

    See also

  4. If applicable, modify your site’s configuration files to account for new paths, database names, passwords, and other differences between your previous host and your WebFaction account.

  5. Copy your database.

    See also

  6. Create (or modify) a website entry to connect an application to a domain name and URL path.

    Note

    You can use username.webfactional.com and its subdomains, where username is your WebFaction account name. It’s ideal for testing a new site before using your own domain.

    If you’re ready to use an existing domain, see Pointing Your Domain to WebFaction’s Servers. DNS changes take up to 48 hours to take effect, so plan ahead.

  7. Confirm the website is working at the correct domain name and URL path.

    Test different site functions, especially critical activities like logging in and accessing administrative areas, to make sure the move went successfully.

Copying Files from an FTP Server

To copy your files from your previous hosting provider with FTP:

  1. Open an SSH session to your account.

  2. Make a copy of the remote FTP files and directory structure. Enter wget --mirror --ask-password ftp://user@host, where user is the username for the remote FTP account, and host is the hostname or IP address of the remote FTP server, and press Enter.

    The files download into a new directory named after the FTP hostname. Large or numerous files and directories may require a long wait to download.

The files are downloaded to your your WebFaction account and can be found through SFTP and SSH. Although the files are stored on the WebFaction server, they are not yet served publicly on the web. Please see Moving a Site to WebFaction for details.

Importing a Database from phpMyAdmin

To export a database from phpMyAdmin and import it to your WebFaction server:

  1. Download your existing database.

    1. Log in to your previous hosting provider’s phpMyAdmin.
    2. In the left sidebar, click on the database to export.
    3. Click the Export tab.
    4. Click the Export tab.
    5. If not already selected, click to select the following export options:
      • Export ‣ SQL
      • Options ‣ Structure
      • Options ‣ Data
      • Save as file
    6. Download the SQL dump file. Click the Go button.
  2. Upload the dump file to your home directory.

    See also

    See Connecting with FTP for details on configuring your SFTP client to connect your WebFaction server.

  3. Create a new MySQL database with the control panel.

  4. Import your database dump.

    1. Open an SSH session to your account.

    2. Enter mysql -u username -p -D db_name < dump_file where

      • db_name is the name of the MySQL database you created with the WebFaction control panel,
      • username is the name of a MySQL user with access to the database, and
      • dump_file is the path to the MySQL dump file you uploaded previously,

      and press Enter. A password prompt appears.

    3. Enter the database password and press Enter.

The contents of the database dump are loaded into your WebFaction database. To connect to the MySQL database, see Connecting to a Database.

Moving a WordPress Site

To import a WordPress site from another hosting provider:

  1. Create a Static/CGI/PHP application for WordPress.

  2. Import the database from your existing hosting provider.

    Note

    If you are changing your WordPress site’s URL (for example, from example.com to username.webfactional.com), please see the WordPress documentation article Moving WordPress before importing your database.

    If your previous hosting provider offers phpMyAdmin, see Importing a Database from phpMyAdmin for detailed instructions.

    If you have a dump file, create a new database and import your dump file.

  3. Copy the contents of the directory containing your WordPress site’s files, such as:

    • index.php and wp-config.php, and
    • subdirectories wp-admin and wp-content,

    to your Static/CGI/PHP application directory, $HOME/webapps/wp_app, where wp_app is the name of the application as it appears on the control panel.

    See also

    See Copying Files from an FTP Server for details on how to copy files from your previous hosting provider with your FTP account.

  4. Modify your WordPress application’s configuration file.

    1. Open $HOME/webapps/wp_app/wp-config.php in a text editor.

    2. Update the database name. Modify this line:

      define('DB_NAME', '<database_name>');
      

      such that <database_name> is the name of the database you created as it appears on the WebFaction control panel.

    3. Update the database user. Modify this line:

      define('DB_USER', '<user>');
      

      such that <user> is the name of a user that owns or has permission to use the database you created.

    4. Update the database password. Modify this line:

      define('DB_PASSWORD', '<password>');
      

      such that <password> is the password for the database user.

    5. Update the database hostname. Modify this line:

      define('DB_HOST', 'some.host.name');
      

      to this line:

      define('DB_HOST', 'localhost');
      
    6. Save and close the file.

  5. Create a new website record to serve the Static/CGI/PHP application.

    See also

    See Create a Website with the Control Panel for details on how to create a website record.

The WordPress site is available at the domain and URL you selected.