Open the file on SSAS server on which you want to create the Cube. Execute the script by hitting F5. Refresh the database list and check the new database has appeared on the list.
Expand the Data Sources node to get the list of data sources. Go through each of the data sources in the cube and change the connection string for all of them. The connection string is available as data source properties.