Need to Change Domain Name

cblair's Avatar

cblair

28 Jul, 2014 05:51 PM

I need to change the domain name on my AdvertPro ad server. Are there any instructions / warnings I should heed in doing that?

  1. Support Staff 1 Posted by Mike Cherichett... on 28 Jul, 2014 06:45 PM

    Mike Cherichetti's Avatar

    Hi Chris,

    What we recommend doing is setting up the new domain as an alias. That way you can use both old and new domains simultaneously. Depending on your setup this may be possible to do without any configuration changes at all.

    The first step is to point the new domain at the IP address of the server that's running AdvertPro.

    If you run a web server such as Apache or Nginx in front of Tomcat you will need to add an alias for the new domain in their respective configuration files. When running Tomcat in standalone mode (i.e. it's running on port 80) no configuration changes are needed. Tomcat will route all domains to the default host where AdvertPro is installed automatically.

    Once you've verified the new domain is working and you can access AdvertPro through it the next step would be to change all of your zone codes to use the new domain if desired.

    If you plan to remove the old domain you should run the following SQL queries to replace any references that may be contained in the MySQL data followed by a Tomcat restart to refresh the data:

    UPDATE media_applet SET code = replace(code,'example.olddomain.com','example.newdomain.com');
    UPDATE media_applet SET codebase = replace(codebase,'example.olddomain.com','example.newdomain.com');
    UPDATE media_applet SET archive = replace(archive,'example.olddomain.com','example.newdomain.com');
    UPDATE media_applet SET clicktag = replace(clicktag,'example.olddomain.com','example.newdomain.com');
    UPDATE media_applet SET image = replace(image,'example.olddomain.com','example.newdomain.com');
    UPDATE media_applet SET redirect = replace(redirect,'example.olddomain.com','example.newdomain.com');
    UPDATE media_applet SET content = replace(content,'example.olddomain.com','example.newdomain.com');
    UPDATE media_dynamic SET url = replace(url,'example.olddomain.com','example.newdomain.com');
    UPDATE media_dynamic SET content = replace(content,'example.olddomain.com','example.newdomain.com');
    UPDATE media_flash SET movie = replace(movie,'example.olddomain.com','example.newdomain.com');
    UPDATE media_flash SET clicktag = replace(clicktag,'example.olddomain.com','example.newdomain.com');
    UPDATE media_flash SET image = replace(image,'example.olddomain.com','example.newdomain.com');
    UPDATE media_flash SET redirect = replace(redirect,'example.olddomain.com','example.newdomain.com');
    UPDATE media_flash SET content = replace(content,'example.olddomain.com','example.newdomain.com');
    UPDATE media_graphic SET image = replace(image,'example.olddomain.com','example.newdomain.com');
    UPDATE media_graphic SET redirect = replace(redirect,'example.olddomain.com','example.newdomain.com');
    UPDATE media_graphic SET textlink = replace(textlink,'example.olddomain.com','example.newdomain.com');
    UPDATE media_graphic SET content = replace(content,'example.olddomain.com','example.newdomain.com');
    UPDATE media_html SET url = replace(url,'example.olddomain.com','example.newdomain.com');
    UPDATE media_pagepeel SET small = replace(small,'example.olddomain.com','example.newdomain.com');
    UPDATE media_pagepeel SET large = replace(large,'example.olddomain.com','example.newdomain.com');
    UPDATE media_pagepeel SET redirect = replace(redirect,'example.olddomain.com','example.newdomain.com');
    UPDATE media_html SET content = replace(content,'example.olddomain.com','example.newdomain.com');
    UPDATE media_text SET redirect = replace(redirect,'example.olddomain.com','example.newdomain.com');
    UPDATE media_text SET content = replace(content,'example.olddomain.com','example.newdomain.com');
    UPDATE media_vast SET content = replace(content,'example.olddomain.com','example.newdomain.com');
    UPDATE media_wallpaper SET images = replace(images,'example.olddomain.com','example.newdomain.com');
    UPDATE media_wallpaper SET redirect = replace(redirect,'example.olddomain.com','example.newdomain.com');
    UPDATE media_window SET url = replace(url,'example.olddomain.com','example.newdomain.com');
    UPDATE media_window SET base = replace(base,'example.olddomain.com','example.newdomain.com');
    UPDATE media_window SET content = replace(content,'example.olddomain.com','example.newdomain.com');
    UPDATE sizes SET image = replace(image,'example.olddomain.com','example.newdomain.com');
    UPDATE sizes SET redirect = replace(redirect,'example.olddomain.com','example.newdomain.com');
    UPDATE sizes SET textlink = replace(textlink,'example.olddomain.com','example.newdomain.com');
    UPDATE sizes SET content = replace(content,'example.olddomain.com','example.newdomain.com');
    

    You'll of course need to edit those SQL queries to change example.olddomain.com and example.newdomain.com to your respective domain names.

    Finally, the last step would be to delete the old domain. That would involve removing it from the Apache or Nginx configuration if those are being used. Then the DNS for the domain could be deleted as well. In most cases, I advise keeping the old domain active for a while. Just in case you find that you missed some pages when updating the zone codes to use the new domain.

    Thanks,
    Mike

  2. 2 Posted by cblair on 28 Jul, 2014 07:32 PM

    cblair's Avatar

    Thanks, Mike. The problem I'm trying to solve is making sure the client's
    domain shows up in Google Analytics referral data. Right now it is my
    domain. I tried changing the zone codes, but the media still loads with a
    link to the old domain. Would that be fixed by the sql updates you list?

    When I made this change and restarted Tomcat the system went down. Does it
    take a few moments for the site to work after tomcat is restarted? I also
    restarted the server but the site remained down (though again, I may not
    have waited long enough). I restored my database and the site started
    working again. May be due to time elapsing or it may be because of the
    database changes.

    I used your SQL and replaced old and new domains with the old and new
    domains.

    I'm now back online, but still with the old domain. Any thoughts?

    Chris

    Chris Blair
    eBLAIR Solutions, Inc.
    (513) 685-4488

    www.eblairsolutions.com

  3. Support Staff 3 Posted by Mike Cherichett... on 29 Jul, 2014 02:27 AM

    Mike Cherichetti's Avatar

    Yes, the SQL queries need to be run to update the URLs of the media files to use the new domain.

    On average a Tomcat restart will usually take 10 seconds, but I've seen them take as long as a minute depending on the size of your database and system resources.

    I'd suggest you check the ~/tomcat/logs/catalina.out and ~/tomcat/webapps/ROOT/logs/error_log_2014-07-28 files for errors to see if there were any startup issues. Particularly in the Tomcat catalina.out log when it finishes starting you will see a INFO: Server startup in 12345 ms message indicating a completed startup. If that message is not present you probably did not wait long enough for it to start back up.

    Also, if you happen to have Apache in front of Tomcat with mod_jk or mod_proxy_ajp they can take an additional 30 seconds or so to detect when Tomcat is back up before they start passing on requests again.

    Thanks,
    Mike

  4. Mike Cherichetti closed this discussion on 04 Aug, 2014 03:51 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

31 Mar, 2021 03:15 PM
03 Aug, 2020 08:33 PM
22 Jun, 2020 06:51 PM
07 Feb, 2020 05:39 PM
10 Dec, 2019 05:28 PM

Recent Articles