Bench migration error

Install / Update migrate
after restore database and copy site_config.json from old server

Migrating site1.local
    Traceback (most recent call last):
      File "/usr/lib/python2.7/runpy.py", line 174, 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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
        main()
      File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
        click.Group(commands=commands)(prog_name='bench')
      File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
        return self.main(*args, **kwargs)
      File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 697, in main
        rv = self.invoke(ctx)
      File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
        return callback(*args, **kwargs)
      File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
        return f(get_current_context(), *args, **kwargs)
      File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
        ret = f(frappe._dict(ctx.obj), *args, **kwargs)
      File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 217, in migrate
        migrate(context.verbose, rebuild_website=rebuild_website)
      File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 31, in migrate
        frappe.modules.patch_handler.run_all()
      File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 24, in run_all
        executed = [p[0] for p in frappe.db.sql("""select patch from `tabPatch Log`""")]
      File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 123, in sql
        self.connect()
      File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 69, in connect
        use_unicode=True, charset='utf8mb4')
      File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/__init__.py", line 86, in Connect
        return Connection(*args, **kwargs)
      File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 204, in __init__
        super(Connection, self).__init__(*args, **kwargs2)
    _mysql_exceptions.OperationalError: (1045, "Access denied for user '1bd3e0294da19198'@'localhost' (using password: YES)")

@rmehta @nabinhait
Dear All

Any suggesting for that error

Hi,
The error says access denied to connect to mysql. Not sure about site name and password in you old and new instance. You just need to copy the encryption key from the old site config.
Thanks

@Ranjith
Thanks for your response
as i mentioned i’m already copy the site_config.json from old site but still got the error but the site name is different

@Alaa_Badri

Please check the mysql service & check log.

Thanks

@sagar
Thanks for your response
mysql service is run but how can i check log

Do not copy entire file, just copy the encryption key from old config and paste in new config.

@Ranjith
Okay but i have no config file in the new site my be because i’m not start the setup wizard i just restore the backup directly after fresh installation

@Alaa_Badri
Site config is created when you do bench new-site command. By default it will have the db name and password field.