mirror of
https://github.com/opensolutions/ViMbAdmin.git
synced 2026-04-26 00:36:00 +03:00
Page:
V2 Migrate from postfixadmin
Pages
About
Announcing ViMbAdmin v3.0.0
Archiving Mailboxes
Configuration
Contributor License Agreement
Deleting Mailboxes
Export Settings
Full setup installation (ViMbAdmin postfix dovecot)
Home
Install Database PostgreSQL
Install Database SQLite
Installation
Mail System Install on Ubuntu
Mailbox Sizes
Migrate from ViMbAdmin2
Migrate from Postfix Admin
Plugins
Plugins: Access Permissions
Quotas
SSL Support
Skinning
Third Party Applications
Updating
V2 Access Permissions
V2 Config Files for full domain aliasing
V2 Install using git
V2 Installation instructions
V2 Migrate from postfixadmin
V2 Password Schemes
V2 Release Procedure
V2 Update Instructions
V2 Postfix and MySQL Integration
Vagrant
No results
2
V2 Migrate from postfixadmin
Andre Flemming edited this page 2016-03-17 15:35:07 +01:00
Table of Contents
Introduction
ViMbAdmin was designed to be compatible with Postfix Admin.
To use ViMbAdmin with your existing Postfix Admin database, you need to perform a small migration.
Install ViMbAdmin from Git as described on Install Using Git and then replace the database creation step with the below.
Warning
Before you start, backup your database.
The information is provided AS IS, without warranty.
Details
The MySQL migrations needed are as follows (YMMV):
ALTER TABLE `admin` DROP PRIMARY KEY , ADD UNIQUE `username` ( `username` );
ALTER TABLE `admin` ADD `id` BIGINT( 20 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `admin` ADD `super` TINYINT( 1 ) NULL;
UPDATE admin SET `password` = SHA1( CONCAT( `password`, 'your_security_salt' ) ); // Works only with cleartext password.
// set one of your admin users to be a super
ALTER TABLE `alias` DROP PRIMARY KEY , ADD UNIQUE `address` ( `address` );
ALTER TABLE `alias` ADD `id` BIGINT( 20 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `domain` DROP PRIMARY KEY , ADD UNIQUE `domain` ( `domain` );
ALTER TABLE `domain` ADD `id` BIGINT( 20 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `domain_admins` DROP `active`;
ALTER TABLE `domain_admins` ADD `id` BIGINT( 20 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
RENAME TABLE `domain_admins` TO `domain_admin` ;
ALTER TABLE `log` ADD `id` BIGINT( 20 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `log` ADD INDEX `username` ( `username` );
ALTER TABLE `log` ADD INDEX `domain` ( `domain` );
ALTER TABLE `mailbox` DROP PRIMARY KEY , ADD UNIQUE `username` ( `username` );
ALTER TABLE `mailbox` ADD `id` BIGINT( 20 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `config` ADD COLUMN `created_at` datetime NOT NULL;
ALTER TABLE `config` ADD COLUMN `updated_at` datetime NOT NULL;
We have made some modifications over time to our Postfix Admin mailbox table. You should verify yours resembles:
CREATE TABLE `mailbox` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`maildir` varchar(255) DEFAULT NULL,
`quota` bigint(20) NOT NULL DEFAULT '0',
`local_part` varchar(255) NOT NULL,
`domain` varchar(255) NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '1',
`homedir` varchar(255) DEFAULT NULL,
`uid` bigint(20) DEFAULT NULL,
`gid` bigint(20) DEFAULT NULL,
`access_restriction` varchar(100) DEFAULT NULL,
`created` datetime NOT NULL,
`modified` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
KEY `domain_idx` (`domain`)
);
And create a new token table:
CREATE TABLE `token` (
`id` bigint(20) NOT NULL auto_increment,
`username` varchar(255) NOT NULL,
`type` varchar(255) default NULL,
`token` varchar(64) default NULL,
`rid` varchar(64) default NULL,
`created_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `username_idx` (`username`)
);