Skip to content

Commit

Permalink
Apply database migration on backup restore
Browse files Browse the repository at this point in the history
Backups restored to a newer version of SecureDrop may introduce breakage
if a migration has occurred. dpkg-reconfigure will call the postinst
which will in turn apply all necessary alembic migrations to the
database.
  • Loading branch information
emkll committed Aug 24, 2018
1 parent f922012 commit b6a15d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion install_files/ansible-base/roles/restore/files/restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def main():
# If the process exits with a non-zero return code, raises an exception.
subprocess.check_call(['service', 'apache2', 'restart'])
subprocess.check_call(['service', 'tor', 'reload'])

# Apply database migrations (if backed-up version < version to restore)
subprocess.check_call(['dpkg-reconfigure', 'securedrop-app-code'])

if __name__ == "__main__":
main()

0 comments on commit b6a15d4

Please sign in to comment.