1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-06-28 16:06:49 +00:00
seafile-server/scripts/upgrade/win32/py/upgrade_2.1_3.0.py

33 lines
790 B
Python
Raw Normal View History

2016-08-10 06:53:33 +00:00
# coding: UTF-8
import os
from upgrade_common import install_path, ccnet_dir, seafile_dir, upgrade_db, run_argv
def do_migrate_storage():
'''use seaf-migrate to migrate objects from the 2.1 layout to 3.0 layout'''
args = [
os.path.join(install_path, 'seafile', 'bin', 'seaf-migrate.exe'),
'-c', ccnet_dir,
'-d', seafile_dir,
]
print 'Starting migrate your data...\n'
if run_argv(args) != 0:
raise Exception('failed to migrate seafile data to 3.0 format')
def main():
try:
upgrade_db('3.0.0')
do_migrate_storage()
except Exception, e:
print 'Error:\n', e
else:
print '\ndone\n'
finally:
print '\nprint ENTER to exit\n'
raw_input()
if __name__ == '__main__':
main()