s3-printing: Move all tdb upgrade functions to a separate file.