Author Topic: SOLVED: best strategy for a migration  (Read 1092 times)

Offline Phil242

  • Newbie
  • *
  • Posts: 4
SOLVED: best strategy for a migration
« on: February 02, 2020, 05:14:22 AM »
Hi dudes,

Since years I use Debian with the Roundcube package. But as Debian stable is very late (it's normal) I'll move to a new server, maintaining myself the updates of Roundcube.
But I need to keep my user's data.

Today it run on Debian 9, means Roundcube 1.2.3, and I'll install the last stable version.

What's the best strategy? Dump the database and try to run update.sh? But as I'll don't have any old folder, not sure it'll works.

Or, maybe just restoring database, run this from the update.sh and not use a fresh empty one:
  170     // check database schema
  171     if ($RCI->config['db_dsnw']) {
  172         echo "Executing database schema update.\n";
  173         $success = rcmail_utils::db_update(INSTALL_PATH . 'SQL', 'roundcube', $opts['version'],
  174             array('errors' => true));
  175     }

I don't care of the cache, just user data.

Thanks for your suggestions.

Phil
« Last Edit: March 28, 2020, 10:07:11 AM by Phil242 »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,612
    • http://SKaero.com/
Re: best strategy for a migration
« Reply #1 on: February 02, 2020, 02:01:03 PM »
Move the database and then follow the standard update path https://github.com/roundcube/roundcubemail/wiki/Upgrade

Offline Phil242

  • Newbie
  • *
  • Posts: 4
Re: best strategy for a migration
« Reply #2 on: February 05, 2020, 06:14:31 PM »
Hi,

Ok, so I'll follow this path and see what happened.

Thanks for the suggestion.

Cheers,

Phil

Offline Phil242

  • Newbie
  • *
  • Posts: 4
Re: best strategy for a migration
« Reply #3 on: March 05, 2020, 07:04:35 PM »
Hi,

I've work again on this upgrade, and no success.

Here is what I obtain when I take from my old server's Roundcube folder (from Debian 1.2.3 .deb installation):

Code: [Select]
root@myserver:~/roundcubemail-1.4.3# ./bin/update.sh ../oldRoundcube/
What version are you upgrading from? Type '?' if you don't know.
1.2.3
This instance of Roundcube is not yet configured!
Open http://url-to-roundcube/installer/ in your browser and follow the instuctions.

(If I enter "1.2.3", or "2015111100" or "?" it does the same output)

It seems the Debian version is too far from the source installation and the update script is lost.
(I had to create myself the config/ folder because Debian store elsewhere the config files)


But, as I explain before, I just need to upgrade the roundcube database from 1.2.3 to 1.4.3, to keep the address-book of my users. I really don't care of the old Roundcube file folder, I'll use the last stable official tarball.
Is there a way to just run bin/updatedb.sh under my running and restored database? And then install roundcube with this existing database?

Code: [Select]
MariaDB [(none)]> use roundcube;
MariaDB [roundcube]> select * from system;
+-------------------+------------+
| name              | value      |
+-------------------+------------+
| roundcube-version | 2015111100 |
+-------------------+------------+


Thanks for your advices.

Phil

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,441
Re: best strategy for a migration
« Reply #4 on: March 06, 2020, 02:23:50 AM »
Quote
Is there a way to just run bin/updatedb.sh under my running and restored database? And then install roundcube with this existing database?

You'll need to setup your new config files first then I think this will do it:

Code: [Select]
./bin/updatedb.sh --dir ./SQL --package roundcube
the first arg is the path to the SQL folder in the root of your Roundcube installation and the second is always 'roundcube'
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline Phil242

  • Newbie
  • *
  • Posts: 4
SOLVED: Re: best strategy for a migration
« Reply #5 on: March 28, 2020, 10:05:25 AM »
Hi,

Some news of the migration strategy to keep my old database 1.2.3 and run a 1.4.3 version from scratch on a new server.

I was trying to follow the advice of JohnDoh, setup a fresh install and run the update script by hand before run Roundcube.
And here is even more simple way to do:

  • Restore your old database in a fresh SQL database
  • Follow the documentation for a fresh new install
  • During the process enter the credentials for the restored database
  • At step 3 (or step 2, please correct me) it ask you to test the database connexion, do it
  • The setup probe a wrong database schema and ask you to update it, do it
  • Finish your setup and that's it!

The point is it exist a neat feature: testing an existing database schema and run the database schema for you. Great!

Maybe I've miss it under the doc, but it worth to be added  8).

Thanks for your supports.

Cheers,

Phil