Server migration

Hello, i'm going to migrate Elgg to another server, but when i do this, i lost a lot of files because in database we have the old path , can you help me?  how i change in all database one part of path with new path? Example: /var/www/ads/dfhs/image.jpg for /path/newsite/www/ads/dfhs/image.jpg