In theory, it should be sufficient to backup and restore /var/lib/docker as long as
– the os is the same on source and target system
– the filesystem /var/lib/docker is identical on source and target system
– the cpu architecture is identical on source and target system
– the docker version is the same on source and target system
– you didn’t use bind-mount volumes (which mount a host folder into a container folder)
#2 is cruical: make sure the Storage Driver remains the same, otherwise existing image and container data could be ignored by a different Storage Driver.
May I ask how you did the backup of /var/lib/docker?