12

Is there an easy and safe way to back up and restore an entire texlive installation, e.g. before a fresh OS (re)installation or to put onto another pc (same architecture)?

What I have in mind is to simply copy (rsync) my whole texlive directory (~/texlive) to my external HD, i.e. along with my usual home directory backup, then copy it back into my (new) home directory after doing a fresh install of Xubuntu. As far as I know, everything tex-related is in ~/texlive.

But I don't know whether tlmgr perhaps has a backup option (for entire texlive installations, not just packages), or if there's a better way. I also don't know if my proposal requires something extra, like updating tlmgr or what.

6 Answers 6

12

Short answer: On Unix, copying the whole texlive directory is the correct way to backup and/or duplicate a whole TeX Live installation and is guaranteed to work. In TeX Live on Unix, everything lies in the texlive directory by design.

More details. If you used the "symlink" option during installation or installed symlinks later using tlmgr path add then you'll want to run this command on your new installation after restoring the files (possibly after setting the directories using tlmgr option sys_bin, sys_man and sys_info).

If you have anything in your ~/texmf, you'll obviously want to back it up too. Things in ~/.texlive2011/texmf-var are generated, you don't need to back them up. Files in ~/.texlive2011/texmf-config on the other hand hold configuration information (for example if you installed a font mapping only for your user using updmap (as opposed to updmap-sys)) so you'll probably want to back it up if it exists. Unless of course it was created by mistake (running updmap and fmtutil instead of their -sys variants is a common mistake), then you'll want to fix that before backing up.

Finally, as nplatis said, if your new architecture is different from the old one, install the new architecture before you do the backup/duplication.

1
  • Great, thanks. And for reference, to see a list of all platforms available from the repository for installation, run tlmgr platform list, which also marks which one(s) you currently have installed. To add new architectures, run tlmgr platform add ARCH1 ARCH2 ..., and to remove, tlmgr platform remove ARCH1 ARCH2 .... Feb 7, 2012 at 13:40
5

I have successfully duplicated a TeXLive installation simply by duplicating all the texlive folder (in my case, /usr/local/texlive). I haven't even copied ~/.texlive2011/ folder, I believe it holds stuff that can be regenerated.

BTW, I have also been able to duplicate the TeXLive installation from an x86_64 machine to an x86 machine: before duplicating the folder I added the 32-bit architecture to texlive, then moved the folder to the new machive, and finally I removed the unneeded architectures from the two machines.

1
  • 2
    Of course one should not forget the ~/texmf folder, containing personal additions.
    – egreg
    Feb 5, 2012 at 20:05
2

Here's what I do, and so far it has worked -- I can't affirm that it's correct, so your mileage may vary. I do this among Windows systems; I imagine something similar will work for Unix systems; I have no idea whether it will also work Windows <-> Unix, but suspect anyone trying this out should not do it where the systems need to be stable. That said, here goes:

New Installation on first machine:

  1. Install from the TexLive CD
  2. Bring it up-to-date with tlmgr
  3. I install everything. Up to you.

This is now the "Master Copy"

New Installation on second and subsequent machines:

  1. Install from the TexLive CD
  2. Test the installation
  3. Mirror copy the Master Copy to this Slave Copy (this is an operation equivalent to deleting the contents of the Slave and copying over the whole Master -- rsync --delete might be a useful option here). This is required because things occasionally move around in the tree, and you don't want old versions left over.

These are now the "Slave Copies"

Maintenance of Master:

Just do it normally with tlmgr

Maintenance of Slave(s):

Mirror copy as above. Just in case it isn't obvious, never do maintenance on a Slave Copy.

2
  • Step 1 and 2 on slaves are useless. (Unless you use the "symlink" option at installation time.)
    – mpg
    Feb 6, 2012 at 8:35
  • Quite possibly, but I don't trust Windows not to hide something vital in the PATH, or the registry, or setting up shortcuts in my start menu. Feb 6, 2012 at 8:37
1

Another option would be to reinstall on the second system using the first system's installation profile. From the install-tl docs:

-profile profile

Load the file profile for repeated installations on different systems. This is useful for batch or scripted installation of TeX Live, that is, no user interaction is required.

A profile file contains all the values needed to perform an installation. After a normal installation has finished, a profile for that exact installation is written to the file DEST/tlpkg/texlive.profile. That file can be given as the argument to -profile to redo the exact same installation on a different system, of rexample. Alternatively, you can create a custom profile by starting from a generated one and changing values.

We use this on Windows to do silent installs of TeX Live on each system's C: drive. Should work just as well on Linux.

3
  • His question is not clear to me. Why would anybody want to keep old installation of TeXLive on the new system? Configuration files yes but old binaries? I am guessing he could use damp and restore to do that as long as old binaries can run on the new installation? Mike you know more about Unix than me. What am I missing here? Feb 6, 2012 at 0:23
  • 1
    The new installation might be a reinstall of the same OS for whatever reason. No worry about incompatibilities there. Maybe Internet access is expensive there, and a DVD download or network reinstall is inconvenient. Just guesses. Feb 6, 2012 at 4:00
  • 1
    Mike is right - I have a severely limited monthly data transfer limit, so ~3 GB (the full texlive) eats up quite a bit of that allotment. Feb 6, 2012 at 4:31
1

I usually keep my TL on a separate partion (/opt in my case), when I reinstall I simply ask the installer to use this partition as /opt and not reformat it. Then after the OS reinstall I usually have to edit /etc/environment (Ubuntu) and perhaps install the TL equivs package. I've done this on my netbook for a few years now works fine.

0

Have you tried using a "portable installation"?

http://www.tug.org/texlive/doc/texlive-en/texlive-en.html#tlportable

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .