Sunday, May 1, 2016

How to make your own Zimbra Server and Migrate it by Corey Albright Sr. aka Halfaway




Zimbra is an: Free Email, Calendaring, and Enterprise Application Server 

If you do not want to read the stuff in between the lines skip to the part where the steps begin:




* I. Creating a Zimbra Server in 25 Minutes

* II. Moving / Migrating Zimbra (3.5 hours + data transmission)










Zimbra installed with Docker (25 minutes) 
You will need to sit at your computer a total of: 2.5 hours when doing this task(New Zimbra) if from scratch
You will need to sit at your computer a total of: 40 hours if you are repairing a possible or older Zimbra server and are migrating a database with all fields.



"Congratulations on making it this far.  Docker, Ansible, and AWS are making it much more easier, requiring less resources, and allowing developers/engineers to get to market quickly."

- Corey Albright


It took more time writing this article than to do the actual project with docker.


Today we will be working with two clean Zimbra's right out of the box and using a thing called docker to keep both our frustration and time to market quick and easy.

What Tools you will need:

AWS (Amazon Web Services) "Lowers time & costs for concept to production" you could even eliminate an entire datacenter and all the costs associated with it.1
Be fully remote without distractions!!!! (Cellphone, Slack, Email, or Smoke signal)
Your favorite music without (lyrics) "I prefer dubstep"
3 cups of coffee (The waits in between will allow a healthy walk) or 10mg of Aderall
1 Red bull
1 Bag of grapes (enough to increase your metabolism to workout after this quick tutorial)

Knowledge Needed for this project and explained below:

[{FOCUS}] <-- must know how to focus
FQDN and MX records
Routing and Aliases
GIT
Linux
Hostnames
Suffixes
TCP/IP
Porting
Docker
Ansible (If you want to launch more, but only feel like writing a one line script)
Godaddy, Registars, or how the Internet really works!
Zenoss(if you want to professionally monitor your box entirely with open source) "Keep your alerts low so you can relax often"


I. Create a New Zimbra w/ Docker & Git (25 minutes) in AWS!!!

Begin Here with the following steps!!!!

Step 1:  Visit your favorite hostname provider (godaddy.com)
Step 2: Register your name.. Mine will be something unique: (zimbraforfraustandcoomer.com)
Step 3: Create an EC2 Instance with at least 30GB
Step 4: Ensure you have Docker installed (install git too)...
  Use this script and docker will kick off in minutes
Step 5: Launch my script I forked directly from the Zimbra Community
 git clone https://github.com/Zimbra-Community/zimbra-docker.git
Step 6:
copy and paste the command below:

docker run -p 25:25 -p 80:80 -p 465:465 -p 587:587 -p 110:110 -p 143:143 -p 993:993 -p 995:995 -p 443:443 -p 8080:8080 -p 8443:8443 -p 7071:7071 -p 9071:9071 -h zimbra86-docker.zimbra.io --dns 127.0.0.1 --dns 8.8.8.8 -i -t -e PASSWORD=Zimbra2015 zimbra_docker

Step 7: relax your boi Corey aka Don just cut you from 40 hours of testing and frustration to a copy and paste of two scripts!  (never underestimate the power of knowledge, simplicity, and google).


Step 8: Errors will present themselves until you run the below scripts:
docker ps -a 
docker start YOURCONTAINERID
docker exec -it YOURCONTAINERID bash
su - zimbra
zmcontrol restart



II. Moving / Migrating Zimbra 


Known Issues reference: (wiki.zimbra.com) :

  • Personas will not be migrated
  • Identities will not be migrated
  • Domain Resources will not be migrated
  • COS will not be Migrated
  • User Preferences will not be migrated
  • Shared resources will not work after the migration and must be shared with all users again.
  • When you have Huge Mailboxes, the Tool often randomly fails to migrate some of the data. Please use the CURL export for these Mailboxes, and import them manually in the new Server.


The process of migrating accounts to a ZCS server running a later version of ZCS includes:
  • Provisioning the accounts on the destination server before running zmztozmig 
  • Editing the zmztozmig.conf file in /opt/zimbra/conf on the destination server to configure the import settings
  • Running  zmztozmig to import the account’s data to the destination server



* Note --> You may need to connect the source to a VPN if you are migrating to AWS



Step 1: Pull up both the Source web server and Target Server
 [https://sourceIP:7071] & [https://targetIP:7071] 
Step 2: Go to: Tools & Migration > Account Migration > Migration Wizard



Step 3: Answer the questions for the destination server






Step 4:  Import the Accounting and User accounts



Step 5: Select the following options



Step 6: LDAP easy Transfer option




Advertisement:

Look for: UlyssesOS.com to do great things



Step 7:






Step 8:



Step 9:  Select all the accounts you want to migrate

Step 10:



Step 11:





Step 12: Review and verify your accounts are there



Note if you desire to do it all text base the link to the tutorial is here:

https://wiki.zimbra.com/wiki/Zimbra_to_Zimbra_Migration









What you will learn


How to test ports and what is happening



Know what Zimbra does and how to setup a host as well as use the migration tool zmztozmig 





Hostnames I own if anyone is every interesting buying one, I have been in the cloud for the last 10 years: