Command Line Updating

Command Line Updating

Introduction

Updating the Revive Adserver software has always been a well defined and time proven web based procedure that hasn’t changed much over the past 25 years. It has been documented very clearly and has been perfected over time. The procedure involves a graphical update wizard that can be accessed and operated in your web browser.

Why a command line update tool?

Internally, the development team behind Revive Adserver has been using a command line update tool for some time now. This proved to be extremely useful and efficient for the automated tests to ensure that an upgrade to a new version worked correctly coming from all supported older versions, and for other forms of automated regression testing during development.

We’ve also heard from experienced system administrators that they’d prefer to perform software updates from the command line interface, because it fits in better with their usual workflow, and because they might even be able to script such updates.

With the publication of Revive Adserver v6.0 in October 2025, we’ve now released this command line update tool as a public beta.

Caution

This page documents how to use the command line updater. As with the traditional web based update wizard, we strongly recommend that you first read the entire process from start to finish, so that you’re certain that you can complete all steps confidently.

Experienced system administrators only

This page assumes you are comfortable and experienced with command line operations like creating new folders, downloading files using the ‘wget’ command, decompressing archives, changing file and folder permissions, copying files or folders from one location to another, and so on. Depending on your server and its operating system, you may also have to switch to being a ‘root’ user first.

If there’s anything in the assumptions above or in the instructions below that you don’t completely understand, we strongly recommend against using the command line update process. You may also want to consult a colleague or your ISP.

No support, no guarantees

The Revive Adserver open source project team can not and will not provide any form of dedicated support or assistance for users embarking on using the command line updater. We can not guarantee that it works in all circumstances. If something goes wrong, we will not be able to help you restore your system to the previous working state. Just like with the web based update wizard, our most important recommendation is: Make Backups!

Starting position

As outlined in our documentation page about “Installing Revive Adserver”, we recommend always installing the software in a sub-directory of your domain.

For the purpose of this documentation page, we’re going to assume that you’ve currently got your working version installed in www.example.com/adserver/.
There is a full article about https://www.revive-adserver.com/how-to/decide-on-a-good-location-to-install/.

Important: location of your banner images!

These instructions also assume you’ve configured your installation so that the banner images are NOT stored in the www.example.com/adserver/www/images directory but instead in the /www.example.com/adserver_images folder, as per the recommendations in the article at
https://www.revive-adserver.com/how-to/move-the-banner-image-storage-location/.

This means that the banner images are not going to be affected in any way by the upgrade procedure. This applies to the web based upgrade as well as the command line upgrade.

Adapt these instructions to your situation

The instructions below are intended as a generic example of a process that will work for most situations. You may have decided in the past to use folder names or locations that are different from our recommendations. That’s fine. All you have to do is to adapt the generic instructions below to your specific circumstances.

Preparations

To prepare for the command line upgrade, here are the steps to follow:

  • Make a full backup of your database by exporting (dumping) it. Make sure you store the database export in a safe location that you can access even when something goes wrong to render your server completely inoperable.

  • Make sure you’re working in the folder on the server that represents www.example.com.

  • Download the most recent version of the Revive Adserver software by looking up the relevant download URL on the page at https://www.revive-adserver.com/download/, using the wget command to retrieve that file. For example revive-adserver-x.y.z.tgz.

  • Decompress the downloaded file, which will create a new subfolder revive-adserver-x.y.z

  • Once decompressed, you can delete the archive.

  • Finally, rename the newly created folder revive-adserver-x.y.z to adserver_new, for example:

    mv revive-adserver-x.y.z adserver_new

Now you will need to copy a number of files from the working folder to the new folder:

  • All of the “*.conf.php” files from the /adserver/var/ folder to the /adserver_new/var/ folder
    Assuming you’re currently in the folder that represents www.example.com, enter:

    cp adserver/var/*.conf.php adserver_new/var/.
  • If there are any additional custom files in your working directory, for example .htaccess files for specific access restrictions, make sure to also copy those to the corresponding locations in the adserver_new folder.

At this point you have:

  • Your current working version in the ‘adserver’ folder

  • The new version you’re about to update to in the ‘adserver_new’ folder, with a copy of the configuration files from the working version already in place.

Now would be a good time to double check that you have a full backup of your database safely stored somewhere other than on the server you're currently working on.

You’ll also have to lookup and make a note of the username and password of the system administrator user of the Revive Adserver system. These are the same as the credentials you enter when accessing the www.example.com/adserver/www/admin using your browser. Keep these credentials at hand, while making sure they’re not accessible to outsiders.

Also, before performing the actual upgrade, coordinate with the end users of the system so that they’re aware of the impending upgrade and will refrain from accessing the system during the upgrade process.

Performing the command line upgrade

To initiate and complete the upgrade, follow these steps:

  • Make sure you are still in the folder for your (virtual) host www.example.com

  • Use the following commands to rename the adserver and adserver_new folders:

    mv adserver adserver_old; mv adserver_new adserver;
  • Enter the following command to start the upgrade process, replacing the various placeholders with the correct values using the explanation below:

    php adserver/scripts/installer upgrade adserver_old -u ADMIN_USERNAME -p ADMIN_PASSWORD -P

    (everything on a single line)

  • Explanation:

    • php adserver/scripts/installer upgrade is the upgrade command itself

    • the adserver_old argument informs the updater about the folder location of the ‘old’ files, so that it knows where to look for the currently configured plugins

    • the -u option is mandatory, and it informs the upgrade script about the system administrator username you’ve made a note about during the preparations

    • the -p option is also mandatory, and it informs the upgrade script about the system administrator’s password. Since a secure password can contain all sorts of special characters, you can embed it in double quotes to make sure it’s passed to the update in one piece.

    • the optional -P option instructs the upgrade script that it should check and fix any file and folder permissions during and after the process. Note that -p (for password) and -P (for Permissions) are distinct parameters.

  • In case the upgrade command isn’t able to auto-detect the hostname of the installation, you will need to add the -H option, e.g. -H www.example.com.

  • The upgrade script will now start and first check if all of the mandatory parameters are present and if it can access the necessary files and folders. It will display something like:

    cli-update-precheck-complete.png

     

  • Enter ‘y’ for yes and press the enter key.

  • The upgrade script will now perform the entire process from start to finish, keeping you informed about its progress along the way, for example:

    cli-update-complete.png

     

    The entire process can take multiple seconds, depending on the specification of your server, the size of the database, the complexity of the steps, the number of plugins and so on.

After the upgrade script completes, you have:

  • Your new working version in the ‘adserver’ folder

  • The old version you worked with before in the ‘adserver_old’ folder, with its configuration files still intact and completely untouched.

Now you can inform the end users of the system that they can start using the application again.

We recommend keeping the ‘adserver_old’ folder around for a few hours or days until you’ve made absolutely sure that everything is working correctly after the upgrade. You should also hang on to the database export during that time.

Finishing up

After the update completes, we recommend locking your configuration by setting the file permissions of the *.conf.php files in the adserver/var folder to make them read-only.

How to recover if the upgrade fails

In the unlikely event that something went horribly wrong during the upgrade, you can recover the old version by restoring the database from your backup and by renaming the ‘adserver’ folder to ‘adserver_broken’ and the ‘adserver_old’ folder back to ‘adserver’.

All upgrade parameters documented

By using the --help parameter, the script can list all available mandatory and optional parameters for the upgrade process, like this:

php adserver/scripts/installer upgrade --help

The output on screen will look like this:

cli-upgrade-help.png