LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Transfering files to new system, how to? (https://www.linuxquestions.org/questions/linux-newbie-8/transfering-files-to-new-system-how-to-4175642568/)

Tagiga 11-17-2018 02:13 PM

Transfering files to new system, how to?
 
So,

if i reinstall a distro/install new one,

What is the most simple, smoothiest way to get control over the old userfiles (documents and so) on the new fresh install? I've always ended up just to recreate the old files if there has been complains about not owner of the file, or so, bcause not knowing for sure what to do. Afraid that breaking up something, or like losing files.

I've tried to search simple answer but instructions have been bit complex.

Like if the files are on usb stick memory or external usb disk, what is the correct procedure?

Ztcoracat 11-17-2018 02:19 PM

First backup all of your files onto a usb memory stick or and external hard disk drive.

Perform the fresh installation of the distro and than just plug in the usb memory stick or external HDD and copy all of the files to the new installed system.

Tagiga 11-17-2018 02:49 PM

:) But i always get these owner of file problems. So it's not normal to get them, right? How do solve the owner things without always sudo to use the file? It's not always every file but there's often some files, documents (created by myself on old system) which require owner change, or sudo them to edit.

Like i had some C++ programs coded by me, all of those were under previous ownership.

BW-userx 11-17-2018 02:51 PM

2. you can on your next "distro" install is split your system, giving /home its own partition. this way if you ever do re-install, or change distors, you can keep your home then just attach it to the next install by pointing to its mount point during installation.

moduser or usermod
chown

are commands useful in controlling your file permissions. search on them, and get yourself comfortable in using them.

Ztcoracat 11-17-2018 04:06 PM

Permissions can really turn you around until you understand them.
If you haven't already take a look here:

https://www.linux.com/learn/understa...le-permissions

frankbell 11-17-2018 08:03 PM

BW-userx's suggestion is excellent. Since I started using a separate /home, life with upgrades and even installs of new distros has been much easier.

ondoho 11-18-2018 03:55 AM

Quote:

Originally Posted by Tagiga (Post 5927123)
But i always get these owner of file problems.

show us.
it's probably an easy fix, but you need to show us first.
get busy with a terminal; open the containing folder in a terminal and issue
Code:

ls -al

agillator 11-18-2018 04:11 AM

When it comes to owners and permissions remember there is one gotcha that can bite. The system does not use usernames for files, but uids and gids. The passwd and group files in /etc provide the names we are so used to. If your new system has different user ids and group ids then then your users will have problems. So step one is to make sure the user/uid and group/gid lists are the same. Then make sure your method of backing up and copying maintains the original uids and gids. rsync can be useful there.

zeebra 11-18-2018 04:52 AM

Quote:

Originally Posted by Tagiga (Post 5927111)
So,

if i reinstall a distro/install new one,

What is the most simple, smoothiest way to get control over the old userfiles (documents and so) on the new fresh install? I've always ended up just to recreate the old files if there has been complains about not owner of the file, or so, bcause not knowing for sure what to do. Afraid that breaking up something, or like losing files.

I've tried to search simple answer but instructions have been bit complex.

Like if the files are on usb stick memory or external usb disk, what is the correct procedure?

There is no "correct" procedure, but in my experience, the easiest way is to make sure the file permissions are by uid and gid instead of username and groupname.. That way you can always use the same user id and group id and the permissions carry over.

Regarding file "transfer" to the new distribution, I would recommend always having /home on a separate partition, and simply remount this under /home in the new distro to keep all the files etc from the old system.

alexpaton 11-19-2018 09:08 AM

Personally I tend to copy all of my files over to my new home folder, then run the following:-
PHP Code:

cd /home
chown 
-<username> <username

This sets every file in your user folder and every sub-folder to be owned by your user. HOWEVER, Ubuntu at least, has started sneaking files into the home folder, which are not owned by the user, so there is now potential for things to go very wrong, following this. In order to get around this, I now pick and choose which files & folders to copy over, which is less lazy, less prone to going wrong, and leads to a much cleaner home (I have previously found stray folders from programs which I haven't used in 5 years).

EDIT: oh, and if you are installing a different version of the OS, overwriting the defaults on a good few folders can cause things to not work properly. This will vary depending on the OS and Desktop, but dconf is one I don't bother copying over.


All times are GMT -5. The time now is 10:58 PM.