V4 to V5 Database Restore

Hello all,

Can someone please let me know the process for restoring a V4 DB in a V5 installation
I tried following steps which I got in a few posts on the forum but it did not work out successfully:
Would like to know if I am missing something or is something wrong in these steps.

erpnext4@erpnext4ubu5:~/ bench init frappe-bench-v5 --frappe-branch v5.x.x
erpnext4@erpnext4ubu5:~/ bench get-app GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP) --branch v5.x.x
erpnext4@erpnext4ubu5:~/ bench new-site site-v5

erpnext4@erpnext4ubu5:~/bench restore SQL_FILE
Got these error below and it says that the Database is already created…! Unable to understand when did it get created.

return click.group(name=app, commands=app_commands)(app_group)
/home/erpnext4/frappe-bench-5/apps/frappe/frappe/utils/bench_helper.py:14: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
click.Group(commands=commands)(prog_name=‘bench’)
MySQL root password:
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/erpnext4/frappe-bench-5/apps/frappe/frappe/utils/bench_helper.py”, line 77, in
main()
File “/home/erpnext4/frappe-bench-5/apps/frappe/frappe/utils/bench_helper.py”, line 14, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/erpnext4/frappe-bench-5/env/local/lib/python2.7/site-packages/click/core.py”, line 700, in call
return self.main(*args, **kwargs)
File “/home/erpnext4/frappe-bench-5/env/local/lib/python2.7/site-packages/click/core.py”, line 680, in main
rv = self.invoke(ctx)
File “/home/erpnext4/frappe-bench-5/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext4/frappe-bench-5/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext4/frappe-bench-5/env/local/lib/python2.7/site-packages/click/core.py”, line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/erpnext4/frappe-bench-5/env/local/lib/python2.7/site-packages/click/core.py”, line 508, in invoke
return callback(*args, **kwargs)
File “/home/erpnext4/frappe-bench-5/env/local/lib/python2.7/site-packages/click/decorators.py”, line 16, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/erpnext4/frappe-bench-5/apps/frappe/frappe/commands.py”, line 27, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/erpnext4/frappe-bench-5/apps/frappe/frappe/commands.py”, line 129, in restore
_new_site(db_name, site, mariadb_root_username=mariadb_root_username, mariadb_root_password=mariadb_root_password, admin_password=admin_password, verbose=context.verbose, install_apps=install_app, source_sql=sql_file_path, force=context.force)
File “/home/erpnext4/frappe-bench-5/apps/frappe/frappe/commands.py”, line 85, in _new_site
install_db(root_login=mariadb_root_username, root_password=mariadb_root_password, db_name=db_name, admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
File “/home/erpnext4/frappe-bench-5/apps/frappe/frappe/installer.py”, line 31, in install_db
create_database_and_user(force, verbose)
File “/home/erpnext4/frappe-bench-5/apps/frappe/frappe/installer.py”, line 53, in create_database_and_user
raise Exception(“Database %s already exists” % (db_name,))
Exception: Database c780dd4236 already exists