How can i migrate Postal V1 MariaDB inside Docker Container to V2 #1592
Unanswered
bstaub
asked this question in
Help with using Postal
Replies: 1 comment
-
|
I'm confused as to what your question is but I've noticed you're apparently not running postal V2 because of I don't think you need to move the database but if you must, you will either need to figure out replication or do a lot of mysqldumps and imports. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear Forum
How can i migrate Postal V1 MariaDB inside Docker Container to V2 on Ubuntu 20.04?
i have configured /opt/posta/config/postal.yml like this:
`
main_db:
host: 127.0.0.1
username: postal
password: mySecretPassword
database: postal
message_db:
host: 127.0.0.1
username: postal
password: mySecretPassword
prefix: postal
`
when i execute the postal :
"sudo postal upgrade"
i got this error:
Mysql2::Error::ConnectionError: Access denied for user 'postal'@'172.17.0.1'
...
vagrant@postal01-test-vagrant:/opt/postal/install$ sudo postal upgrade
warning: redirecting to https://github.com/postalserver/install/
From https://postalserver.io/start/install
Already up to date.
No version specified, using latest available version...
Upgrading to 2.0.0
Pulling web ... done
Pulling smtp ... done
Pulling worker ... done
Pulling cron ... done
Pulling requeuer ... done
Creating postal_runner_run ... done
Migrating database
rake aborted!
Mysql2::Error::ConnectionError: Access denied for user 'postal'@'172.17.0.1' (using password: YES)
/usr/local/bundle/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in
connect' /usr/local/bundle/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:ininitialize'/usr/local/bundle/gems/activerecord-5.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:22:in
new' /usr/local/bundle/gems/activerecord-5.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:22:inmysql2_connection'/usr/local/bundle/gems/activerecord-5.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:830:in `new_connection'
...
My MariaDB in on the Host i execute the update Script is running -> 27.0.0.1:3306->3306/tcp
vagrant@postal01-test-vagrant:/opt/postal/app/config$ sudo docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
036f44ee6745 ghcr.io/postalserver/postal:2.0.0 "/docker-entrypoint.…" 42 minutes ago Up 42 minutes postal_runner_run_51908c7b4019
5ddb13eac72d rabbitmq:3.8 "docker-entrypoint.s…" 46 minutes ago Up 46 minutes 4369/tcp, 5671/tcp, 15691-15692/tcp, 25672/tcp, 127.0.0.1:5672->5672/tcp postal-rabbitmq
6ff6a03912c7 mariadb:10.2 "docker-entrypoint.s…" 2 hours ago Up 2 hours 127.0.0.1:3306->3306/tcp postal-mariadb
`
I have also tested inside the the runner container this command....the same problem.
where can i setup the database connection?
...
postal@postal01-test-vagrant:~/app/db/migrate$ bundle exec rake db:migrate --trace
(in /opt/postal/app)
** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:migrate
rake aborted!
Mysql2::Error::ConnectionError: Access denied for user 'postal'@'172.17.0.1' (using password: YES)
/usr/local/bundle/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in
connect' /usr/local/bundle/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:ininitialize'/usr/local/bundle/gems/activerecord-5.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:22:in `new'
...
Is is possible to define the mysql2 database connection to the Docker Maria DB server inside the runner container?
postal@postal01-test-vagrant:~/app/db/migrate$ find / -name 'database.yml'
/opt/postal/app/config/database.yml ??
something like this..
...
default:
adapter: mysql2
encoding: utf8
database: postal
pool: 5
username: ******
password: "******"
host: localhost
# host: postal-mariadb
...
Thanks for help
Regards
Bruno Staub
Beta Was this translation helpful? Give feedback.
All reactions