Using a temporary URL for a SiteGround migration

I needed a temporary URL for testing a site while migrating it into SiteGround.

I’d already set up a blank WordPress install via their cPanel WordPress install tool, but I needed a temporary URL to work with while I migrated the files and database over, and in order to test it show it to the client before switching the domain name from pointing to the current host to SiteGround:

I tried a few hacky techniques but in the end it was simple as:

  1. clicking the ‘Access Site via IP’ button in the main SiteGround (not Cpanel) control panel, as explained here:
    https://www.siteground.co.uk/tutorials/getting_started/transfer_point_domain.htm#s3
  2. Taking that URL and adding it to your wp-config.php file:
    define('WP_HOME','http://77.105.146.214/~cpanelusername/');
    
    define('WP_SITEURL','http://77.105.146.214/~cpanelusername/');

Now you should be able to access that site (including logging in to the WordPress admin) via that URL.

NB. This for the ‘primary’ domain installed on the root of SiteGround, I don’t know what mileage you’ll have with other domains / installs (though if you find something that works / is better please add it as a comment below!)

7 responses to “Using a temporary URL for a SiteGround migration”

  1. Susan Marshall Avatar

    Thank you for this. I was trying to find this on SiteGround and couldn’t. This is exactly what I needed.

    1. RD Avatar
      RD

      Thanks – as with Susan just needed this to view a sites progress before we switched over and SG help didn’t seem to have it.

  2. Fernando Saling Avatar

    Thank you!
    I did changing the URL in table wp-options (MySQL). There are two records, “siteurl” and “home”.

  3. Sam Avatar
    Sam

    Hi Nick,

    I found this incredibly helpful on a current project. Thank you so much. I have one question, though:

    Since the URL of all the pages and images use the server IP address, will I have to run a Search & Replace in the database to change the URLs to the actual domain address once I point the DNS records? Or do I just need to delete the two lines of code we added from the wp-config file, point the DNS, and the URLs will resolve themselves?

    Thanks!
    Sam

  4. Cal Avatar

    Great post- to add some direction I still had to discover where this was but you got me started…
    My Accounts Tab > Informations and Settings Tab – here it is…

    T H A N K S

  5. Josh Avatar

    Doesn’t work anymore. The function has changed or moved.

  6. Jacob Holwerda Avatar

    Thank you so much! This was exactly what I was looking for. Siteground is great, but not with the information to get started with a temporary domain name. Now I can show my clients the new website, before changing the domain name.

Leave a Reply

Your email address will not be published. Required fields are marked *