I've created a map with lots of layers and info box info and sql codes, but now I need to use a different dataset from the one I was originally using. Is there a quick way to just swap out the dataset (all the fields are the same)? I haven't been able to find it on any of the documentations on Cartodb.
There's no official way to do this, but there's a trick you can use.
Add the new dataset you want to use as a new layer. If you need to copy the styles of the previous dataset, you can just copy and paste pretty easily in this view.
Now, delete the old dataset layer. This will just leave a single layer with your new data, and any changes you have made to the map itself such as adding elements, configurations, or metadata will remain. Also, with this approach you still have the same map with the same map id, so if you shared it already it will continue working!
You could also change the SQL query in your current layer to point to the new dataset, but this could point to confusions in the future and perhaps you can end up deleting something you don't want to. :-)