<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cmd_copy():
 settings. When used with --force, an existing database with the same name as DEST is replaced, the original is renamed out of place in the form DEST_old_YYYYMMDD (unless --no-backup is specified). """

    db = connect()

    if args.force and db_exists(db, args.dest):
        tmp_db = generate_alt_dbname(db, args.dest, 'tmp')
        pg_copy(db, args.src, tmp_db)

        pg_move_extended(db, tmp_db, args.dest)

    else:
        pg_copy(db, args.src, args.dest)