If you have an existing setup of the WhatsApp Business API Client and want to migrate to a new setup using the same phone number and app settings, this guide will help you identify changes and what you need to do about them.

Data Migration

During migration, some data can be backed up using the WhatsApp Business API and restored onto the new setup, while some will need to be manually migrated.

Data that can be backed up from the old setup and restored onto the new one, includes:

  • App settings
  • Registration
  • Encryption keys

Refer to the Backup and Restore documentation for details.

Other data, such as messages, callbacks, contact information, and authentication tokens, are stored in the database but are NOT backed up during the aforementioned backup-restore process. If your migration involves changing databases (e.g., switching from a database container on your developer machine to a standalone database process on a compute server), the database needs to be manually migrated.

Migration process

Here is an overview of the general migration process:

  1. Back up your old authentication token.
  2. Use the old authentication token to back up data from the old setup per the Backup documentation.
  3. If a new database will be used, back up the database using a utility such as mysqldump or pg_dump, otherwise, skip this step.
  4. Uninstall the old setup. Refer to the Uninstalling section of the respective Installation guide for instructions.
  5. If a new database will be used, restore the database backup created in step 3 on the new database.
  6. Follow the Installation documentation for setting up the new WhatsApp Business API Client.
  7. Obtain an authentication token to prepare for data restore:
    a. If the same database is used, use the old authentication token.
    b. In cases where a new database is used, the old authentication token will be invalid. You need to perform a first-time login on the new setup followed by a standard login to obtain a new authentication token.
    Note: If you used mysqldump or pg_dump to back up and restore the database, the old auth token will still be valid.
  8. Use the token to perform a restore on the new setup. Refer to the Restore documentation for instructions to keep using the same registered phone number and app settings with the new setup.
  9. Perform a health check and send a test message to verify the WhatsApp Business API is running properly.