This whitepaper lists the steps needed to migrate from a Microsoft CRM Online deployment to a Microsoft Dynamics CRM 4.0 on-premise deployment.  This process will move all the CRM data as well as the customizations and configurations to an Onpremise deployment.

Microsoft CRM Online Data Migration to Microsoft Dynamics CRM 4.0 On-Premise