Skip to content

Migrating an existing Laravel installation

If you’ve developed a Laravel application locally or on another hosting provider, you can migrate it to your ruachost.com hosting account. This process ensures your project files and configurations are properly set up to run on your new server.

  • Move projects from local development to production.
  • Transfer applications between hosting providers.
  • Maintain consistency across environments.
  1. Upload Laravel Project Files.

    • Use cPanel File Manager or SFTP to upload your Laravel project files to your hosting account.
    • Place them in your home directory (e.g., /home/username/project).
  2. Log in via SSH.

    • Connect to your hosting account using SSH.

    • To enable running Artisan easily, add an alias:

      Terminal window
      echo 'alias artisan="php /home/username/project/artisan"' >> ~/.bashrc
      source ~/.bashrc
  3. Make Public Files Accessible.

    • Copy all files from the Laravel public directory to your public_html folder:

      Terminal window
      cp -r ~/project/public/* ~/public_html
    • Alternatively, copy to a subdirectory (e.g., public_html/laravel):

      Terminal window
      cp -r ~/project/public/* ~/public_html/laravel

      In this case, your site will be accessible at http://example.com/laravel.

  4. Update index.php Paths.

    • Open public_html/index.php in a text editor.

    • Update the following lines to point to your Laravel project directory:

      require __DIR__.'/../project/vendor/autoload.php';
      require __DIR__.'/../project/bootstrap/app.php';
  5. Configure Environment File.

    • Edit .env in your Laravel project directory.
    • Update database, mail, and app settings to match your ruachost.com environment.
  6. Run Migrations and Seeders.

    • From SSH, run:

      artisan migrate
      artisan db:seed
    • This will set up your database schema and seed initial data.

  7. Verify Installation.

    • In your browser, go to http://example.com.
    • You should see your Laravel application running.