[OpenSIPS-Users] Migrate OpenSIPs database 3_1 to 3_2 Python Error
Social Boh
social at bohboh.info
Sat Feb 11 17:34:01 UTC 2023
My fault,
before i have to compile opensips 3.2 and then:
*opensips-cli -x database migrate 3.1_to_3.2 opensips opensips_3_2*
where opensips is my old opensips database and opensips_3_2 is the new
opensips database create by *opensips-cli database migrate* command
Thank you
---
I'm SoCIaL, MayBe
El 11/02/2023 a las 10:49 a. m., Joseph Jackson escribió:
>
> Hi,
>
> You need to download the scripts and then define the path.
>
> Example -
>
> opensips-cli -o database_schema_path=~/src/opensips-3.2/scripts -x
> database migrate 3.1_to_3.2 opensips_mig_3_1 opensips_mig_3_2
>
>
>
> ------------------------------------------------------------------------
> *From:* Users <users-bounces at lists.opensips.org> on behalf of Social
> Boh <social at bohboh.info>
> *Sent:* Friday, February 10, 2023 3:45 PM
> *To:* users at lists.opensips.org <users at lists.opensips.org>
> *Subject:* [OpenSIPS-Users] Migrate OpenSIPs database 3_1 to 3_2
> Python Error
>
> Hello
>
> I'm trying to migrate OpenSIPs 3_1 database to OpenSIPs 3_2 esquema
>
> OpenSIPs version: 3.1.13
>
> Linux: Almalinux 8
>
> Python 3
>
> opensips-cli -x database migrate 3.1_to_3.2 opensips_3_1 opensips_3_2
>
> where opensip_3_1 is the database name of 3.1 Esquema y opensips_3_2 the name of the new opensips 3.2 Esquema
>
> Error:
>
> /usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/default.py:552:
> Warning: (1305, 'PROCEDURE opensips_3_1.OSIPS_DB_MIGRATE_3_1_TO_3_2
> does not exist')
> cursor.execute(statement, parameters)
> /usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/default.py:552:
> Warning: (1305, 'PROCEDURE opensips_3_1.OSIPS_TB_COPY_3_1_TO_3_2 does
> not exist')
> cursor.execute(statement, parameters)
> Traceback (most recent call last):
> File
> "/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/base.py",
> line 1244, in _execute_context
> cursor, statement, parameters, context
> File
> "/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/default.py",
> line 552, in do_execute
> cursor.execute(statement, parameters)
> File
> "/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/cursors.py",
> line 255, in execute
> self.errorhandler(self, exc, value)
> File
> "/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/connections.py",
> line 50, in defaulterrorhandler
> raise errorvalue
> File
> "/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/cursors.py",
> line 252, in execute
> res = self._query(query)
> File
> "/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/cursors.py",
> line 378, in _query
> db.query(q)
> File
> "/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/connections.py",
> line 280, in query
> _mysql.connection.query(self, query)
> _mysql_exceptions.OperationalError: (1304, 'PROCEDURE
> OSIPS_TB_COPY_3_0_TO_3_1 already exists')
>
> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
> File "/usr/local/bin/opensips-cli", line 4, in <module>
> __import__('pkg_resources').run_script('opensipscli==0.1.0',
> 'opensips-cli')
> File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py",
> line 654, in run_script
> self.require(requires)[0].run_script(script_name, ns)
> File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py",
> line 1434, in run_script
> exec(code, namespace, namespace)
> File
> "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/EGG-INFO/scripts/opensips-cli",
> line 9, in <module>
> run_console()
> File
> "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/EGG-INFO/scripts/opensips-cli",
> line 6, in run_console
> main.main()
> File
> "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/main.py",
> line 78, in main
> sys.exit(shell.cmdloop())
> File
> "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/cli.py",
> line 242, in cmdloop
> ret = self.run_command(module, command, modifiers, params)
> File
> "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/cli.py",
> line 404, in run_command
> return mod[0].__invoke__(cmd, params, modifiers)
> File
> "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/module.py",
> line 36, in __invoke__
> return f(params, modifiers)
> File
> "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/modules/database.py",
> line 789, in do_migrate
> migrate_scripts, old_db, new_db, DB_MIGRATIONS[flavour])
> File
> "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/db.py",
> line 827, in migrate
> self.exec_sql_file(ms)
> File
> "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/db.py",
> line 569, in exec_sql_file
> self.__conn.execute(sql)
> File
> "/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/base.py",
> line 982, in execute
> return self._execute_text(object_, multiparams, params)
> File
> "/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/base.py",
> line 1155, in _execute_text
> parameters,
> File
> "/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/base.py",
> line 1248, in _execute_context
> e, statement, parameters, cursor, context
> File
> "/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/base.py",
> line 1466, in _handle_dbapi_exception
> util.raise_from_cause(sqlalchemy_exception, exc_info)
> File
> "/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/util/compat.py",
> line 383, in raise_from_cause
> reraise(type(exception), exception, tb=exc_tb, cause=cause)
> File
> "/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/util/compat.py",
> line 128, in reraise
> raise value.with_traceback(tb)
> File
> "/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/base.py",
> line 1244, in _execute_context
> cursor, statement, parameters, context
> File
> "/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/default.py",
> line 552, in do_execute
> cursor.execute(statement, parameters)
> File
> "/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/cursors.py",
> line 255, in execute
> self.errorhandler(self, exc, value)
> File
> "/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/connections.py",
> line 50, in defaulterrorhandler
> raise errorvalue
> File
> "/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/cursors.py",
> line 252, in execute
> res = self._query(query)
> File
> "/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/cursors.py",
> line 378, in _query
> db.query(q)
> File
> "/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/connections.py",
> line 280, in query
> _mysql.connection.query(self, query)
> sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError)
> (1304, 'PROCEDURE OSIPS_TB_COPY_3_0_TO_3_1 already exists')
>
> --
> ---
> I'm SoCIaL, MayBe
> y
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20230211/89c18208/attachment-0001.html>
More information about the Users
mailing list