• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Migrating Hosts to New Server

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    3
    11
    1.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      Critchleyb
      last edited by

      Hi,

      I’m trying to migrate my host list to a new server.

      I’ve attempted to export the CSV from the old server, however it puts the CSV in a format that seems broken.

      Some of the hosts, the MAC hasn’t exported at all, on the ones that it has, it hasn’t put in any semi colons, so FOG refuses to import them.

      I have around 700 hosts and it’s not viable to manually enter the semi colons. I also want to avoid exporting the entire database as there are a lot of different configuration settings on my new server as its a different network environment.

      Any advice appreciated.

      1 Reply Last reply Reply Quote 0
      • S
        Sebastian Roth Moderator
        last edited by

        @Critchleyb Just noticed that I have overlooked something myself. You’ll need to export and import MAC address table (don’t forget the MAC address association table).

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        C 1 Reply Last reply Reply Quote 1
        • george1421G
          george1421 Moderator
          last edited by george1421

          What version of FOG going to what version of FOG?

          Is the function broken on the export or import side?

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

          1 Reply Last reply Reply Quote 1
          • C
            Critchleyb
            last edited by

            Old version was 1.5.0-RC-2

            Trying to import to 1.5.5.

            I believe the export is what is causing the issue. Has this been tweaked in a later version?

            george1421G 1 Reply Last reply Reply Quote 0
            • george1421G
              george1421 Moderator @Critchleyb
              last edited by

              @Critchleyb I can’t say for sure. Probably yes since you are even on a RC release.

              I was going to recommend a database way to exporting the table, but then I remembered about table dependencies.

              So in stead I would recommend that you bring your old FOG server up to 1.5.5. Realize it will function differently than 1.5.0rc2. But the goal is to get the export to work correctly.

              1. Export your Image definitions first
              2. Migrate the images raw files (/images) to your new FOG server
              3. Import your images.csv into your new fog server
              4. Export your hosts definitions from the old fog server.
              5. Import the host definitions into your new FOG server.

              If you can’t upgrade your old fog server for some reason then can you show us what is doing to the csv file to make it unusable?

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

              1 Reply Last reply Reply Quote 1
              • C
                Critchleyb
                last edited by

                Thanks, I’ll try that when i’m back in the office tomorrow.

                Thankfully I don’t need to transfer the images over, so its a little simpler.

                The old server is in use by another team and still needs to carry on working. But hopefully i’ll be able to update it without issues.

                1 Reply Last reply Reply Quote 0
                • C
                  Critchleyb
                  last edited by

                  I also attempted to export the database following this guide but just for the hosts table:

                  https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG

                  using

                  Old Server:

                  mysqldump fog hosts > hosts.sql
                  

                  New Server:

                  mysql fog < hosts.sql
                  

                  But no luck with that, it exported fine but when i tried to import no data showed in the web portal.

                  1 Reply Last reply Reply Quote 0
                  • S
                    Sebastian Roth Moderator
                    last edited by

                    @Critchleyb said:

                    Some of the hosts, the MAC hasn’t exported at all, on the ones that it has, it hasn’t put in any semi colons

                    Can you give us a couple of lines of examples on this. Possibly we can make a bit more sense of this. Without knowing what exactly the export looks like, it’s hard to help.

                    mysqldump fog hosts > hosts.sql

                    Sounds like a valid road to go but I am wondering what the hosts.sql actually looks like after the export. See if you have any entries in the hosts table after the import: mysql -e 'SELECT COUNT(*) FROM hosts' fog

                    Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                    Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                    C 1 Reply Last reply Reply Quote 1
                    • C
                      Critchleyb @Sebastian Roth
                      last edited by

                      @Sebastian-Roth

                      Hello,

                      Seems like the data was imported. Count * shows 1193 entries in the table.

                      No data showing in the hosts list on the web portal however.

                      1 Reply Last reply Reply Quote 0
                      • S
                        Sebastian Roth Moderator
                        last edited by Sebastian Roth

                        @Critchleyb Default view in the hosts list is search and does not show any hosts! Sure you clicked on the “List all hosts” link in the left menu? Just wanna make sure.

                        You can change the default view to list instead of search in FOG Configuration -> FOG Settings …

                        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                        1 Reply Last reply Reply Quote 0
                        • S
                          Sebastian Roth Moderator
                          last edited by

                          @Critchleyb Just noticed that I have overlooked something myself. You’ll need to export and import MAC address table (don’t forget the MAC address association table).

                          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                          C 1 Reply Last reply Reply Quote 1
                          • C
                            Critchleyb @Sebastian Roth
                            last edited by

                            @Sebastian-Roth

                            Sorted!

                            As soon as i imported the hostMAC table they all appeared in the web portal.

                            For anybody reading in the future:

                            To Migrate just your Host list, you will need to export both the “hosts” and “hostMAC” tables from the old database using mysqldump, then import them both into the new database. Just doing the hosts table will not make them show in the web portal.

                            1 Reply Last reply Reply Quote 1
                            • 1 / 1
                            • First post
                              Last post

                            245

                            Online

                            12.0k

                            Users

                            17.3k

                            Topics

                            155.2k

                            Posts
                            Copyright © 2012-2024 FOG Project