• Rrgomezc

      Moolevel 1
    • Edited

    Hello,

    I need to move my actual mailcow server (running on a Ubuntu VM) to another phyisical host; I already have a VM running Ubuntu (same version and updates as the original one) on the target host, and I create regularly backups from the original server to the new one using the create_cold_standby.sh script.

    But I have never done anything with this new VM. The script finishes and that’s it. I haven’t tried running mailcow on the new VM, nor anything like that. I just check that the files are copied, no errors returned, and that’s it. Now I do need to make the new VM the production instance for my mailcow installation.

    So, my starting question would be: to have a running MailCow instance on the new server, I just need to docker compose up -d the backup created with create_cold_standby.sh script and that’s it? In the documentation it just says that it can be used to migrate to a new server, but doesn’t mention anything about that. I guess/hope that it is because the process is this simple.

    I understand that I have to modify DNS and all that to point to the IPs of the new host, but as far as MailCow goes, it’s just creating the backup and starting up the instance on the target server? I have a fairly standard MailCow installation, I don’t recall any mods nor anything like that to the configuration files, for instance. I believe it’s a vanilla install.

    Thanks!

      • DocFraggle

        • Community Hero
        Moolevel 322

      rgomezc I just need to docker compose up -d the backup created with create_cold_standby.sh script and that’s it?

      Yes, that’s all 🙂

      Have something to say?

      Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

      Thanks @DocFraggle! I will try to make the switch later today.

      • Rrgomezc

          Moolevel 1
        • Edited

        So… I tried this and when calling sudo docker compose up -d I got the following output:

        [+] Running 4/6
         ✔ Container mailcowdockerized-olefy-mailcow-1      Started                                                                                                1.0s 
         ⠋ Container mailcowdockerized-unbound-mailcow-1    Starting                                                                                               1.1s 
         ✔ Container mailcowdockerized-memcached-mailcow-1  Started                                                                                                1.1s 
         ✔ Container mailcowdockerized-dockerapi-mailcow-1  Started                                                                                                1.1s 
         ⠋ Container mailcowdockerized-sogo-mailcow-1       Starting                                                                                               1.1s 
         ✔ Container mailcowdockerized-netfilter-mailcow-1  Started                                                                                                0.9s 
        Error response from daemon: error while creating mount source path '/opt/mailcow-dockerized/data/conf/unbound/unbound.conf': mkdir /opt/mailcow-dockerized: read-only file system

        I am not sure what to check or change in this case… :/

        Mhm, ok, apparently the new server has docker installed via snap, which for what I can find on the internet causes this problem. I remember installing it the same as the old VM but maybe I did not…

        • DocFraggle

          • Community Hero
          Moolevel 322

        Don’t use sudo, run everything as root use directly

        Mhm, ok, apparently the new server has docker installed via snap, which for what I can find on the internet causes this problem. I remember installing it the same as the old VM but maybe I did not…

        Well, Docker is/was installed like that. But apparently there was also the “snap” version, I don’t know why/how.

        I am rebooting now after uninstalling the snap version and see if things are now normal, as now apparently the docker deamon is not running on the new server…

          • DocFraggle

            • Community Hero
            Moolevel 322

          rgomezc I suggest you run the script again after rebooting to set things right again

          • Rrgomezc

              Moolevel 1
            • Edited

            I can now start the mailcow instance on the new server, but I get this:

            WARN[0000] volume "mailcowdockerized_sogo-web-vol-1" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume 
            WARN[0000] volume "mailcowdockerized_rspamd-vol-1" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume 
            WARN[0000] volume "mailcowdockerized_clamd-db-vol-1" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume 
            WARN[0000] volume "mailcowdockerized_crypt-vol-1" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume 
            WARN[0000] volume "mailcowdockerized_vmail-vol-1" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume 
            WARN[0000] volume "mailcowdockerized_redis-vol-1" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume 
            WARN[0000] volume "mailcowdockerized_mysql-vol-1" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume 
            WARN[0000] volume "mailcowdockerized_mysql-socket-vol-1" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume 
            WARN[0000] volume "mailcowdockerized_sogo-userdata-backup-vol-1" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume 
            WARN[0000] volume "mailcowdockerized_vmail-index-vol-1" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume 
            WARN[0000] volume "mailcowdockerized_postfix-vol-1" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume

            For what I can see in other posts and so on, it’s just a warning and I should be able to safely ignore it… but.. is there a way to “upgrade” or recreate those volumes to avoid this warning? I guess I could delete completely the backup from the new server and start from scratch, but I would like to avoid transferring 100Gb of data if I can 😛

            Edit: I tried with docker compose down -vand it removed the containers… I’m running the create_cold_standby.shscript again and see if everything works fine afterwards.

            Edit2: that did delete the volumes but also from disk (I am not really very experienced with docker… so this was my newbie thing I guess?) the create_cold_standby.sh is replicating the whole installation again apparently…

            The switch has been done and everything seems to be working fine!

            Thanks!!!

              4 months later

              rgomezc so how were you able to fix it. I’m trying to move my mailcow server to a server with bigger resources. how did you figure it out?

                Hello lumideez - if I remember correctly, the original “error”, or the cause for the issues here was that I had installed docker with snap.

                I uninstalled it and installed the correct docker version following the instructions on Mailcow, ran the create_cold_standby.sh script again, and that was it. It is as easy as that.

                If you don’t have the snap-installed version of docker then you should not have any issues.

                No one is typing