That sounds like you did configure S3 via site settings, not env variables as Kris suggested. The restore process needs to know about S3. That’s not possible with site settings.
You could also create a backup without uploads on the console of you want: discourse backup --sql_only
Restoring such a backup won’t rewrite upload URLs. So, as long as your new server has access to the same S3 bucket, this works.