Change bucket URL through database
faraz last edited by
We have our website which is getting media from Amazon S3 bucket named ie 'oldbucket' and since we have taken website to new AWS account now bucket name is changed ie 'newbucket' and we have copied all media into it.
New media is uploading and showing correctly from 'newbucket' like https://newbucket.s3.eu-west-2.amazonaws.com/media/image-2.jpg and others and but existing images are still being called from 'oldbucket' as URL https://oldbucket.s3.eu-west-2.amazonaws.com/media/image-1.jpg etc...
Can someone tell us how we can change all the URL of https://oldbucket.s3.eu-west-2.amazonaws.com/media/... to https://newbucket.s3.eu-west-2.amazonaws.com/media/...
We tried to download complete database and tried to replace string of "oldbucket" to "newbucket" in database file and import it back but after that for some reason images are not showing and path is of media is falling to /app/uploads folder.