For Pg and MySQL I usually have to resort to replicating to a newer instance then cutting over. Tools like pg_upgrade offer promise but I rarely have the time or access to test with a full production dataset. Hosting provider constraints sometimes limit my options too, such as no SSH to underlying instances.