I have NC19 on Ubuntu 18.04 with php7.3. Before upgrading the production server I want to clone this server to a testserver and test the upgrading there first.
I therefore have setup a testserver with the same configuration. I follow the instructions to backup and restore a server as described here Nextcloud Sicher- & Wiederherstellung – Carsten Rieger IT-Services
but I do the backup from the production server and the restore to the test server.
When I restore the database with the command
mysql -h localhost -unextcloud -pnextcloud nextcloud < /home/osusername/ncdb_6.sql
I get an error
ERROR 1045 (28000): Access denied for user ‘nextcloud’@‘localhost’ (using password: YES)
According to the config.php in both instanses
‘dbname’ => ‘nextcloud’,
‘dbhost’ => ‘localhost’,
…
‘dbuser’ => ‘nextcloud’,
Thanks for answer
The two servers are almost identical. In the config.php the name, host and user are identical
‘dbname’ => ‘nextcloud’,
‘dbhost’ => ‘localhost’,
…
‘dbuser’ => ‘nextcloud’,
The two servers have been set up since long and both have been working normally. I just now want to create a clone of the production server using the testserver
Did you restart the database server? Either it has not taken into account the changes yet or there is something else that you have to allow logins from localhost. If you have phpmyadmin or something similar, it’s easier to go through all the settings of the user.
I logged in to mysql and did the changes from within mysql
DROP DATABASE nextcloud;
CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES on nextcloud.* to nextcloud@localhost IDENTIFIED BY ‘nextcloud’
FLUSH PRIVILEGES;
exit;
and then this command was accepted
mysql -unextcloud -pnextcloud nextcloud < /home/rollanders/ncdb_6.sql
I completed the remaining commands
I had to change trusted domain. The testserver now looks like a clone of the production server.