Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Migrate Apstra Database

Release: Juniper Apstra 4.2
{}
Change Release
date_range 07-Feb-24
CAUTION:

If you bring up a new Apstra server with the same IP address as your old Apstra server without any configuration, when the device agents re-register with the new Apstra server they will revert to an unconfigured "Quarantined" state. You must isolate the new Apstra server from the network while you change its IP address, restore the database and restart the Apstra server.

If you want to maintain the same IP address on the new Apstra server, then bring up a new Apstra server VM (with the same version as the original Apstra server) with a temporary IP address. After migrating an aos_backup to the new Apstra server, the original Apstra server is shut down and the IP address is changed to the original IP address on the new server. We recommend this process if you're using onbox device system agents.

If you want to use a new IP address on the new Apstra server, you must manually reconfigure the aos.conf file for each onbox device system agent. This is not required for offbox device system agents.

To migrate an active instance from one server to another:

  1. Run the command sudo aos_backup to back up the original Apstra server.
    content_copy zoom_out_map
    admin@aos-server:~$ sudo aos_backup
    ====================================================================
      Backup operation completed successfully.
    ====================================================================
    New AOS snapshot: 2023-07-27_22-49-34
    admin@aos-server:~$
  2. Copy the snapshot to the new server using a temporary IP address on the new Apstra server.
  3. Compress and move the snapshot directory to the new Apstra server. This example uses the scp command to copy the file to the new Apstra server using a different IP address.
    content_copy zoom_out_map
    admin@aos-server:~$ sudo tar zcvf aos_backup.tar.gz /var/lib/aos/snapshot/2023-07-27_22-49-3
    2023-07-27_22-49-34/
    2023-07-27_22-49-34/comment.txt
    2023-07-27_22-49-34/aos_restore
    2023-07-27_22-49-34/aos.data.tar.gz
    admin@aos-server:~$ sudo chown admin:admin aos_backup.tar.gz
    admin@aos-server:~$ scp aos_backup.tar.gz admin@172.20.203.4:
    Apstra Operating System (AOS) Virtual Appliance
    
    Password:
    aos_backup.tar.gz                                   100%   20MB 140.9MB/s   00:00
    admin@aos-server:~$
  4. After the snapshot has been removed from the old Apstra server, stop service (or completely shut down the Apstra server VM) to disconnect the old Apstra server.
    content_copy zoom_out_map
    admin@aos-server:~$ sudo service aos stop
    admin@aos-server:~$
  5. If you want to use the same IP address, you must manually reconfigure the eth0 interface on the new Apstra server to the IP address of the old Apstra server. For more information, see the Configuration section of the Juniper Apstra Installation and Upgrade guide.
  6. On the new Apstra server, uncompress the tar.gz file.
    content_copy zoom_out_map
    admin@aos-server:~$ tar zxvf aos_backup.tar.gz
    2023-07-27_22-49-34/
    2023-07-27_22-49-34/comment.txt
    2023-07-27_22-49-34/aos_restore
    2023-07-27_22-49-34/aos.data.tar.gz
    admin@aos-server:~$
  7. Run the command aos_restore to restore the database on the new Apstra server. This command automatically starts the service after restoring the database.
    content_copy zoom_out_map
    admin@aos-server:~$ cd 2023-07-27_22-49-34
    admin@aos-server:~/2023-07-27_22-49-34$ sudo bash aos_restore
    [sudo] password for admin:
    ====================================================================
      Backup operation completed successfully.
    ====================================================================
    New AOS snapshot: 2023-07-27_23-07-13
    Stopping aos_sysdb_1      ... done
    Stopping aos_auth_1       ... done
    Stopping aos_controller_1 ... done
    Stopping aos_nginx_1      ... done
    Stopping aos_metadb_1     ... done
    (Reading database ... 110457 files and directories currently installed.)
    Removing aos-compose (3.3.0-658) ...
    Processing triggers for ureadahead (0.100.0-21) ...
    Processing triggers for systemd (237-3ubuntu10.41) ...
    tar: Removing leading `/' from member names
    /etc/aos/aos.conf
    /etc/aos-credential/secret_key
    /var/lib/aos/db/
    /var/lib/aos/db/_AosController-000000005f1f376f-0003998b-checkpoint
    /var/lib/aos/db/_AosSysdb-000000005f1f376d-000a90ba-log-valid
    /var/lib/aos/db/_Main-000000005f1f376f-000569a8-checkpoint
    /var/lib/aos/db/_Central-000000005f1f376e-000da3de-checkpoint-valid
    /var/lib/aos/db/_Central-000000005f1f376e-000da3de-log
    /var/lib/aos/db/_Main-000000005f1f376f-000569a8-log-valid
    /var/lib/aos/db/_AosAuth-000000005f1f376d-000a40ff-log
    /var/lib/aos/db/_Auth-000000005f1f376e-000f2d35-log-valid
    /var/lib/aos/db/_Auth-000000005f1f376e-000f2d35-checkpoint-valid
    /var/lib/aos/db/_Metadb-000000005f1f376d-000cb9a9-checkpoint-valid
    /var/lib/aos/db/_Central-000000005f1f376e-000da3de-checkpoint
    /var/lib/aos/db/_Metadb-000000005f1f376d-000cb9a9-log
    /var/lib/aos/db/_Credential-000000005f1f376e-000d740e-log-valid
    /var/lib/aos/db/_AosAuth-000000005f1f376d-000a40ff-checkpoint-valid
    /var/lib/aos/db/_Metadb-000000005f1f376d-000cb9a9-checkpoint
    /var/lib/aos/db/_Main-000000005f1f376f-000569a8-log
    /var/lib/aos/db/_AosSysdb-000000005f1f376d-000a90ba-checkpoint-valid
    /var/lib/aos/db/_AosController-000000005f1f376f-0003998b-log-valid
    /var/lib/aos/db/_Auth-000000005f1f376e-000f2d35-checkpoint
    /var/lib/aos/db/_AosSysdb-000000005f1f376d-000a90ba-log
    /var/lib/aos/db/_AosSysdb-000000005f1f376d-000a90ba-checkpoint
    /var/lib/aos/db/_AosAuth-000000005f1f376d-000a40ff-log-valid
    /var/lib/aos/db/blueprint_backups/
    /var/lib/aos/db/blueprint_backups/6b90ccfd-a1e0-4473-83e7-d62bce24635f/
    /var/lib/aos/db/blueprint_backups/6b90ccfd-a1e0-4473-83e7-d62bce24635f/47/
    /var/lib/aos/db/blueprint_backups/6b90ccfd-a1e0-4473-83e7-d62bce24635f/47/graph.json.zip
    /var/lib/aos/db/blueprint_backups/6b90ccfd-a1e0-4473-83e7-d62bce24635f/47/graph.md5sum
    /var/lib/aos/db/_Central-000000005f1f376e-000da3de-log-valid
    /var/lib/aos/db/_Auth-000000005f1f376e-000f2d35-log
    /var/lib/aos/db/_Credential-000000005f1f376e-000d740e-log
    /var/lib/aos/db/_Credential-000000005f1f376e-000d740e-checkpoint
    /var/lib/aos/db/_Credential-000000005f1f376e-000d740e-checkpoint-valid
    /var/lib/aos/db/.devpi/
    /var/lib/aos/db/.devpi/server/
    /var/lib/aos/db/.devpi/server/.nodeinfo
    /var/lib/aos/db/.devpi/server/.secret
    /var/lib/aos/db/.devpi/server/.sqlite
    /var/lib/aos/db/.devpi/server/.serverversion
    /var/lib/aos/db/.devpi/server/.event_serial
    /var/lib/aos/db/_AosController-000000005f1f376f-0003998b-log
    /var/lib/aos/db/_Main-000000005f1f376f-000569a8-checkpoint-valid
    /var/lib/aos/db/_Metadb-000000005f1f376d-000cb9a9-log-valid
    /var/lib/aos/db/_AosAuth-000000005f1f376d-000a40ff-checkpoint
    /var/lib/aos/db/_AosController-000000005f1f376f-0003998b-checkpoint-valid
    /var/lib/aos/anomaly/
    /var/lib/aos/anomaly/_Anomaly-000000005f1f36a4-000aaa68-checkpoint-valid
    /var/lib/aos/anomaly/_Anomaly-000000005f1f331b-0000e8eb-checkpoint
    /var/lib/aos/anomaly/_Anomaly-000000005f1f376f-00002176-checkpoint
    /var/lib/aos/anomaly/_Anomaly-000000005f1f376f-00002176-log
    /var/lib/aos/anomaly/_Anomaly-000000005f1f331b-0000e8eb-log
    /var/lib/aos/anomaly/_Anomaly-000000005f1f2abc-0000a867-log
    /var/lib/aos/anomaly/_Anomaly-000000005f1f331b-0000e8eb-checkpoint-valid
    /var/lib/aos/anomaly/_Anomaly-000000005f1f2abc-0000a867-checkpoint
    /var/lib/aos/anomaly/_Anomaly-000000005f1f36a4-000aaa68-checkpoint
    /var/lib/aos/anomaly/_Anomaly-000000005f1f376f-00002176-log-valid
    /var/lib/aos/anomaly/_Anomaly-000000005f1f36a4-000aaa68-log
    /var/lib/aos/anomaly/_Anomaly-000000005f1f331b-0000e8eb-log-valid
    /var/lib/aos/anomaly/_Anomaly-000000005f1f2abc-0000a867-checkpoint-valid
    /var/lib/aos/anomaly/_Anomaly-000000005f1f2abc-0000a867-log-valid
    /var/lib/aos/anomaly/_Anomaly-000000005f1f36a4-000aaa68-log-valid
    /var/lib/aos/anomaly/_Anomaly-000000005f1f376f-00002176-checkpoint-valid
    /opt/aos/aos-compose.deb
    /opt/aos/frontend_images/
    /opt/aos/frontend_images/aos-web-ui.zip
    Selecting previously unselected package aos-compose.
    (Reading database ... 110440 files and directories currently installed.)
    Preparing to unpack /opt/aos/aos-compose.deb ...
    Unpacking aos-compose (3.3.0-658) ...
    Setting up aos-compose (3.3.0-658) ...
    Processing triggers for ureadahead (0.100.0-21) ...
    Processing triggers for systemd (237-3ubuntu10.41) ...
    Starting aos_nginx_1      ... done
    Starting aos_sysdb_1      ... done
    Starting aos_controller_1 ... done
    Starting aos_metadb_1     ... done
    Starting aos_auth_1       ... done
    admin@aos-server:~/2023-07-27_22-49-34$
  8. Run the command service aos status and verify that the Apstra server is running.
    content_copy zoom_out_map
    admin@aos-server:~/2023-07-27_22-49-34$ service aos status
    * aos.service - LSB: Start AOS management system
       Loaded: loaded (/etc/init.d/aos; generated)
       Active: active (exited) since Thu 2023-07-27 20:23:09 UTC; 2h 45min ago
         Docs: man:systemd-sysv-generator(8)
        Tasks: 0 (limit: 4915)
       CGroup: /aos.service
    admin@aos-server:~/2023-07-27_22-49-34$
  9. From the Apstra GUI, from the left navigation menu, navigate to Devices > Managed Devices to verify that your devices are online in the "Active" state.
footer-navigation