Export User

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Export User

Sasa-8
Hi,
How can I Export my postfix users (my users are stored in sasldblistusers2
and I have 2.3.3 postfix version) for then to import in a new server postfix
server (with 2.5.6 postfix version)?
Thanks in advance.

------

   Salvatore.


Reply | Threaded
Open this post in threaded view
|

Re: Export User

Jorey Bump
Sasa wrote, at 03/13/2009 09:08 AM:

> How can I Export my postfix users (my users are stored in
> sasldblistusers2 and I have 2.3.3 postfix version) for then to import in
> a new server postfix server (with 2.5.6 postfix version)?
> Thanks in advance.

As long as you're compiling against the same Cyrus SASL, there is no
need to export users when you upgrade Postfix. It will recognize the
same sasldb2.

If you need to transfer your sasldb2 to a new machine, it will depend on
the underlying database format/version used. In many cases, you can
simply copy it. But, if the formats are incompatible, you may have to
dump it to text, then recreate it on the new machine.




Reply | Threaded
Open this post in threaded view
|

Re: Export User

Sasa-8
"Jorey Bump" wrote:

> If you need to transfer your sasldb2 to a new machine, it will depend on
> the underlying database format/version used. In many cases, you can
> simply copy it. But, if the formats are incompatible, you may have to
> dump it to text, then recreate it on the new machine.

yes, I want transfer sasldb2 users to another mail server, on my current
mail server I have:

cyrus-sasl-2.1.21
postfix-2.3.3

and for to create user I use:

#saslpasswd2 -c -u mail.example.com -a smtpauth test

On the new mail server I have:

cyrus-sasl-2.1.22
postfix-2.5.6

With this configuration can I simply copy sasldb2 file from current server
to new server ?
Thanks in advance.

------

   Salvatore.



----- Original Message -----
From: "Jorey Bump" <[hidden email]>
To: "Sasa" <[hidden email]>
Cc: "Postfix users" <[hidden email]>
Sent: Friday, March 13, 2009 3:18 PM
Subject: Re: Export User


> Sasa wrote, at 03/13/2009 09:08 AM:
>
>> How can I Export my postfix users (my users are stored in
>> sasldblistusers2 and I have 2.3.3 postfix version) for then to import in
>> a new server postfix server (with 2.5.6 postfix version)?
>> Thanks in advance.
>
> As long as you're compiling against the same Cyrus SASL, there is no
> need to export users when you upgrade Postfix. It will recognize the
> same sasldb2.
>
> If you need to transfer your sasldb2 to a new machine, it will depend on
> the underlying database format/version used. In many cases, you can
> simply copy it. But, if the formats are incompatible, you may have to
> dump it to text, then recreate it on the new machine.
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Export User

Jorey Bump
Sasa wrote, at 03/13/2009 10:58 AM:

> "Jorey Bump" wrote:
>
>> If you need to transfer your sasldb2 to a new machine, it will depend on
>> the underlying database format/version used. In many cases, you can
>> simply copy it. But, if the formats are incompatible, you may have to
>> dump it to text, then recreate it on the new machine.
>
> yes, I want transfer sasldb2 users to another mail server, on my current
> mail server I have:
>
> cyrus-sasl-2.1.21
> postfix-2.3.3
>
> and for to create user I use:
>
> #saslpasswd2 -c -u mail.example.com -a smtpauth test
>
> On the new mail server I have:
>
> cyrus-sasl-2.1.22
> postfix-2.5.6
>
> With this configuration can I simply copy sasldb2 file from current
> server to new server ?

It seems highly probable. It's harmless to test it. In fact, you can run
this command on both machines to verify the format:

 file /etc/sasldb2

If you don't have an sasldb2 on the new machine, just create one by
adding an entry with saslpasswd2. If they're the same type, a simple
copy should work.

Of course, you could just go ahead and copy it and see if it works.
Remember to make backups on both machines.

Reply | Threaded
Open this post in threaded view
|

Re: Export User

Sasa-8
Jorey Bump" wrote:

> It seems highly probable. It's harmless to test it. In fact, you can run
> this command on both machines to verify the format:
>
> file /etc/sasldb2
>
> If you don't have an sasldb2 on the new machine, just create one by
> adding an entry with saslpasswd2. If they're the same type, a simple
> copy should work.

On current mail server I have:

[root@mail ~]# file /etc/sasldb2
/etc/sasldb2: Berkeley DB (Hash, version 8, native byte-order)

on new mail server I have:

[root@mail ~]# file /etc/sasldb2
/etc/sasldb2: Berkeley DB (Hash, version 9, native byte-order)

..the version is different, this is can be a problem ?
Thanks in advance.

------

   Salvatore.

----- Original Message -----
From: "Jorey Bump" <[hidden email]>
To: "Sasa" <[hidden email]>
Cc: "Postfix users" <[hidden email]>
Sent: Friday, March 13, 2009 4:12 PM
Subject: Re: Export User


> Sasa wrote, at 03/13/2009 10:58 AM:
>> "Jorey Bump" wrote:
>>
>>> If you need to transfer your sasldb2 to a new machine, it will depend on
>>> the underlying database format/version used. In many cases, you can
>>> simply copy it. But, if the formats are incompatible, you may have to
>>> dump it to text, then recreate it on the new machine.
>>
>> yes, I want transfer sasldb2 users to another mail server, on my current
>> mail server I have:
>>
>> cyrus-sasl-2.1.21
>> postfix-2.3.3
>>
>> and for to create user I use:
>>
>> #saslpasswd2 -c -u mail.example.com -a smtpauth test
>>
>> On the new mail server I have:
>>
>> cyrus-sasl-2.1.22
>> postfix-2.5.6
>>
>> With this configuration can I simply copy sasldb2 file from current
>> server to new server ?
>
> It seems highly probable. It's harmless to test it. In fact, you can run
> this command on both machines to verify the format:
>
> file /etc/sasldb2
>
> If you don't have an sasldb2 on the new machine, just create one by
> adding an entry with saslpasswd2. If they're the same type, a simple
> copy should work.
>
> Of course, you could just go ahead and copy it and see if it works.
> Remember to make backups on both machines.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Export User

Jorey Bump
Sasa wrote, at 03/13/2009 11:35 AM:

> On current mail server I have:
>
> [root@mail ~]# file /etc/sasldb2
> /etc/sasldb2: Berkeley DB (Hash, version 8, native byte-order)
>
> on new mail server I have:
>
> [root@mail ~]# file /etc/sasldb2
> /etc/sasldb2: Berkeley DB (Hash, version 9, native byte-order)
>
> ..the version is different, this is can be a problem ?

Unfortunately, it might. But Berkeley DB provides decent tools for
dumping databases, so you should be able to easily dump the contents on
the old machine then load them on the new one. I use gdbm for sasldb2,
however, so you'll need to do some research or ask on the appropriate
list. I think db_dump and db_load will do the trick, but I'm not aware
of the steps. Also keep in mind that it's possible to have multiple
versions of Berkely DB installed, so watch out for possible conflicts.




Reply | Threaded
Open this post in threaded view
|

Re: Export User

Bill Cole-3
Jorey Bump wrote, On 3/13/09 12:40 PM:

> Sasa wrote, at 03/13/2009 11:35 AM:
>
>> On current mail server I have:
>>
>> [root@mail ~]# file /etc/sasldb2
>> /etc/sasldb2: Berkeley DB (Hash, version 8, native byte-order)
>>
>> on new mail server I have:
>>
>> [root@mail ~]# file /etc/sasldb2
>> /etc/sasldb2: Berkeley DB (Hash, version 9, native byte-order)
>>
>> ..the version is different, this is can be a problem ?
>
> Unfortunately, it might. But Berkeley DB provides decent tools for
> dumping databases, so you should be able to easily dump the contents on
> the old machine then load them on the new one. I use gdbm for sasldb2,
> however, so you'll need to do some research or ask on the appropriate
> list. I think db_dump and db_load will do the trick, but I'm not aware
> of the steps. Also keep in mind that it's possible to have multiple
> versions of Berkely DB installed, so watch out for possible conflicts.

The easiest tool is db_upgrade. 'db_upgrade /etc/sasldb2' would convert that
file in place on the new machine, assuming that db_upgrade hasn't been
renamed with a version number added or hidden somewhere not in $PATH, both
of which some packaging systems do with BDB to let multiple versions coexist.

FWIW, the BDB utilities have HTML man-like docs that are frequently
well-hidden by packagers, so if you need the details you might have to look
for something like /usr/local/share/doc/db46/utility/db_upgrade.html
Reply | Threaded
Open this post in threaded view
|

Re: Export User

Scott Kitterman-4
In reply to this post by Jorey Bump
On Fri, 13 Mar 2009 12:40:37 -0400 Jorey Bump <[hidden email]> wrote:

>Sasa wrote, at 03/13/2009 11:35 AM:
>
>> On current mail server I have:
>>
>> [root@mail ~]# file /etc/sasldb2
>> /etc/sasldb2: Berkeley DB (Hash, version 8, native byte-order)
>>
>> on new mail server I have:
>>
>> [root@mail ~]# file /etc/sasldb2
>> /etc/sasldb2: Berkeley DB (Hash, version 9, native byte-order)
>>
>> ..the version is different, this is can be a problem ?
>
>Unfortunately, it might. But Berkeley DB provides decent tools for
>dumping databases, so you should be able to easily dump the contents on
>the old machine then load them on the new one. I use gdbm for sasldb2,
>however, so you'll need to do some research or ask on the appropriate
>list. I think db_dump and db_load will do the trick, but I'm not aware
>of the steps. Also keep in mind that it's possible to have multiple
>versions of Berkely DB installed, so watch out for possible conflicts.
>
If this is an upgrade to DB 4.6/4.7 from 4.3/4.4/4.5 (I'm pretty sure it
is) then the on disk format changes only affected databases with
transaction support (which doesn't affect sasldb).  Make backups, etc., but
you should still be able to just copy the file over.

Scott K