Salesforce数据迁移常用技能汇总

本文分享了在香港实施房地产项目时遇到的数据迁移挑战,包括表间连接缺失、代码值映射困难及UniqueID重复等问题,详细阐述了数据迁移的思路与最佳实践。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

背景描述】:
在为香港实施房地产项目时,需要将他的历史数据迁移到新环境,原计划1周搞定,谁料客户提供的数据是我有史以来见过的最糟糕的数据,竟然耗时将近1个月在不断减低标准的情况才使这事有了点眉目,主要原因有3点:
1. 表与表之间无法通过唯一标识建立连接。如:Property(小区) -> Tower(楼栋) -> Unit(房子) -> Listing(放盘)等,这些没有直接的关联,而且客户无法提供关数据库支持;
2. 许多Picklist值为Code。比如地理区域有Area1,2,3,4,但是都是注入93这种Code,客户无法提供一整套映射关系,得从预览源代码方式人工获取;
3. UniqueID有很多重复的记录。在原CRM上存在一个ID对应多个记录情况,目测数据库ID没有勾唯一;

不多吐槽,来看干货>_<

数据迁移思路(含准备工作)】:
1. 参考原系统和数据集Data Sample(xml/json/related document)设计好新系统数据库(原则:不违背原系统);
2. 在Data Model搭建完后的一个多月左右开始准备数据迁移模板,注明必填字段,数据格式,数据示例,并标注部分字段特别处理描述(之所以没及时提供是因为后期开发随着对业务的了解,可能会对字段作相应调整);
3. 在上线前一个月回收数据,清洗处理后根据部分导入测试完后的情况作评估,必要时要求再次处理。此时需要关注数据是否有重复,表间关系是否正确等;
4. 留意数据格式,如日期格式是否符合yyyy-mm-dd,时间格式是UTC还是GMT,超过12位/15位数字如何正常显示,各数据表另存格式是否统一(将直接影响vlookup),数据是否含有特殊不可见字符,文本前后是否有空格等等;

Invalid date and year values accepted by Salesforce is: 1700-01-01 ~ 4000-12-31

Ref: Maximum date and year values accepted by Salesforce

5. 做好数据备份 -> 基于数据量选择导入工具 -> 导入测试 -> 按依赖关系顺序导入 -> 统计成功与失败个数 -> 记录失败原因 -> 协调应急预案等。

清洗数据最佳实践】:
在客户不能根据数据迁移模板提供数据的情况下,在未能掌握Excel数据处理方法情况下Excel处理脏数据的效率是及其低的,此时可以使用Navicat或SQLite轻量级的软件按照历史数据表头建字段,导入后再作清洗处理。

那么如果不是很熟悉MySQL,最常用的Excel技能将总结如下:

Excel常用技能】:本总结适用于windows电脑,mac版Excel可能不太适用
1. vlookup函数技巧解析;
公式:VLOOKUP(para1,para2,para3,para4)
案例:需要基于Id在其他Excel文件表里/同一文件的不同sheet表里查Name;
注意:参考值需要唯一,即ID如果有重复值,Name值将无法获取。
para1 -> 需要基于ID查Name,则ID所在的位置为para1;
para2 -> 其他表的参考数据的列;
para3 -> 其他表选中的列中目标Name所在的列数;
para4 -> 精确/模糊匹配,0/1;


2. 过滤表格后的复制;
选中需要复制的文本 -> Alt + ; -> Ctrl + C

3. 过滤表格后的粘贴;
选中过滤后需要填充的区域 -> Ctrl+G定位 -> 选则可见单元格 -> Ctrl+V

我们可以看到如果出现了分割的列,无法直接复制到过滤行。

4. 快速填充公式值;
选中公式填充域,再公式编辑栏按:Ctrl + Enter,快速填充整个域;

5.快速选中文本至最后一行数据;
在数据列直接不存在空行的情况下,通过Ctrl + Shift + 向下箭头,即可选中该列从初始位置向下的所有数值。

6. 显示+86类型的区号或手机号码;


7. 按特定字符拆分列;


8. 将多列合并成一列;
在公式里面使用&连接字符串,如下:


9. 公式所得文本转文本;
方法一:在第8个技能里面我们获得了Merge值,但是当你选中时依然是公式,所以我们可以把Merge值复制到记事本里面,然后再复制回某个新列,就有公式的文本值了。
方法二:使用方方格子Excel插件工具,选中公式文本并在其前插入单引号。


10. 设置单元格式更改数据格式。
比如,我们想将2018/11/23 -> 2018-11-23


11. 使用Excel标记选中区域重复项:
开始 -> 条件格式 -> 突出显示单元格规则 - > 重复值


12. Excel按某种规则删除符合规则的重复数据并保留其中一条:
https://jingyan.baidu.com/article/11c17a2cdf1acaf446e39d14.html

13. 科学计数法问题处理:
a. 导入数据前一定要注意查看数值类型的数据(金额,电话,身份证等),若包含E+就需要特别处理,即转成文本类型;
如果数值为15位以内的,我们可以使用:设置数据格式 -> 自定义-> 0,来将数据变为文本;

b. 如果数值超过15位,如中国大陆身份证号码,上述操作后3位会补0,此时,需要将csv转成txt,然后从excel外部数据源导入txt,并分列,同时需要特别设定每列的数据格式,如将number类变成text,即可还原真实的ID;

Developing Data Migrations and Integrations with Salesforce: Patterns and Best Practices By 作者: David Masri ISBN-10 书号: 1484242084 ISBN-13 书号: 9781484242087 Edition 版本: 1st ed. 出版日期: 2018-12-19 pages 页数: (359) Migrate your data to Salesforce and build low-maintenance and high-performing data integrations to get the most out of Salesforce and make it a “go-to” place for all your organization’s customer information. When companies choose to roll out Salesforce, users expect it to be the place to find any and all Information related to a customer―the coveted Client 360° view. On the day you go live, users expect to see all their accounts, contacts, and historical data in the system. They also expect that data entered in other systems will be exposed in Salesforce automatically and in a timely manner. This book shows you how to migrate all your legacy data to Salesforce and then design integrations to your organization’s mission-critical systems. As the Salesforce platform grows more powerful, it also grows in complexity. Whether you are migrating data to Salesforce, or integrating with Salesforce, it is important to understand how these complexities need to be reflected in your design. Developing Data Migrations and Integrations with Salesforce covers everything you need to know to migrate your data to Salesforce the right way, and how to design low-maintenance, high-performing data integrations with Salesforce. This book is written by a practicing Salesforce integration architect with dozens of Salesforce projects under his belt. The patterns and practices covered in this book are the results of the lessons learned during those projects. What You’ll Learn Know how Salesforce’s data engine is architected and why Use the Salesforce Data APIs to load and extract data Plan and execute your data migration to Salesforce Design low-maintenance, high-performing data integrations with Salesforce Understand common data integration patterns and the pros and cons of each Know real-time integration options for Salesforce Be aware of common pitfalls Build reusable transformation code covering commonly needed Salesforce transformation patterns
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值