{"id":2707,"date":"2018-05-21T09:02:31","date_gmt":"2018-05-21T16:02:31","guid":{"rendered":"http:\/\/www.wellgolly.com\/?p=2707"},"modified":"2018-05-21T09:02:31","modified_gmt":"2018-05-21T16:02:31","slug":"notes-on-migrating-user-accounts-to-a-new-server","status":"publish","type":"post","link":"https:\/\/www.wellgolly.com\/?p=2707","title":{"rendered":"Notes on migrating user accounts to a new server"},"content":{"rendered":"<p>I found this <a href='https:\/\/www.cyberciti.biz\/faq\/howto-move-migrate-user-accounts-old-to-new-server\/'>link<\/a> that was useful in moving my users to a new machine.<\/p>\n<p><pre><code class=\"preserve-code-formatting\">\nexport UGIDLIMIT=1000\nawk -v LIMIT=$UGIDLIMIT -F: &#039;($3&gt;LIMIT) &amp;&amp; ($3!=65534)&#039; \/etc\/passwd &gt; \/root\/migrate\/passwd.mig\n\nawk -v LIMIT=$UGIDLIMIT -F: &#039;($3&gt;LIMIT) &amp;&amp; ($3!=65534)&#039; \/etc\/group &gt; \/root\/migrate\/group.mig\n\nawk -v LIMIT=$UGIDLIMIT -F: &#039;($3&gt;LIMIT) &amp;&amp; ($3!=65534) {print $1}&#039; \/etc\/passwd | tee - |egrep -f - \/etc\/shadow &gt; \/root\/migrate\/shadow.mig\n\ntar -zcvpf \/root\/migrate\/home.tar.gz \/home\ntar -zcvpf \/root\/migrate\/mail.tar.gz \/var\/spool\/mail\n\ncd \/\ntar -zxvf \/path\/to\/location\/home.tar.gz\n\ncd \/\n# tar -zxvf \/path\/to\/location\/mail.tar.gz<\/code><\/pre><\/p>\n<p>There is one manual step that I needed to do. The procedures above create new groups but do not update the users in existing groups. To find out the current groups for the users run this command:<br \/>\n<pre><code class=\"preserve-code-formatting\">\ngroups (admin_name)<\/code><\/pre><\/p>\n<p>I only need to do this for the handful of admin users on the system, so I didn\u2019t bother to automate it.<\/p>\n<p>Reboot to see your changes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I found this link that was useful in moving my users to a new machine. export UGIDLIMIT=1000 awk -v LIMIT=$UGIDLIMIT -F: &#039;($3&gt;LIMIT) &amp;&amp; ($3!=65534)&#039; \/etc\/passwd &gt; \/root\/migrate\/passwd.mig awk -v LIMIT=$UGIDLIMIT -F: &#039;($3&gt;LIMIT) &amp;&amp; ($3!=65534)&#039; \/etc\/group &gt; \/root\/migrate\/group.mig awk -v LIMIT=$UGIDLIMIT -F: &#039;($3&gt;LIMIT) &amp;&amp; ($3!=65534) {print $1}&#039; \/etc\/passwd | tee &#8211; |egrep -f &#8211; \/etc\/shadow &gt; &hellip; <a href=\"https:\/\/www.wellgolly.com\/?p=2707\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Notes on migrating user accounts to a new server<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-2707","post","type-post","status-publish","format-standard","hentry","category-computers"],"_links":{"self":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/2707","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2707"}],"version-history":[{"count":0,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/2707\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}